ConstPath

Struct ConstPath 

Source
#[repr(transparent)]
pub struct ConstPath<T, const S: char>(pub T);
Expand description

Const-specialized path with named keys separated by a const separator.

Tuple Fields§

§0: T

Implementations§

Source§

impl<T, const S: char> ConstPath<T, S>

Source

pub const fn separator(&self) -> char

The path hierarchy separator.

Source

pub fn into_inner(self) -> T

Extract just the path.

Trait Implementations§

Source§

impl<T: AsRef<str>, const S: char> AsRef<str> for ConstPath<T, S>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: Clone, const S: char> Clone for ConstPath<T, S>

Source§

fn clone(&self) -> ConstPath<T, S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, const S: char> Debug for ConstPath<T, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, const S: char> Default for ConstPath<T, S>

Source§

fn default() -> ConstPath<T, S>

Returns the “default value” for a type. Read more
Source§

impl<'de, T, const S: char> Deserialize<'de> for ConstPath<T, S>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: Display, const S: char> Display for ConstPath<T, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: AsRef<str>, const S: char> IntoKeys for &'a ConstPath<T, S>

Source§

type IntoKeys = <ConstPath<&'a str, S> as IntoKeys>::IntoKeys

The specific Keys implementor.
Source§

fn into_keys(self) -> Self::IntoKeys

Convert self into a Keys implementor.
Source§

impl<'a, T: AsRef<str> + ?Sized, const S: char> IntoKeys for ConstPath<&'a T, S>

Source§

type IntoKeys = <ConstPathIter<'a, S> as IntoKeys>::IntoKeys

The specific Keys implementor.
Source§

fn into_keys(self) -> Self::IntoKeys

Convert self into a Keys implementor.
Source§

impl<T: Ord, const S: char> Ord for ConstPath<T, S>

Source§

fn cmp(&self, other: &ConstPath<T, S>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq, const S: char> PartialEq for ConstPath<T, S>

Source§

fn eq(&self, other: &ConstPath<T, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd, const S: char> PartialOrd for ConstPath<T, S>

Source§

fn partial_cmp(&self, other: &ConstPath<T, S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: Default, const S: char> Seeded for ConstPath<T, S>

Source§

const DEFAULT_SEED: Self::Seed = ()

Default configuration for Self.
Source§

type Seed = ()

The configuration required to construct Self.
Source§

fn from_seed(_: &Self::Seed) -> Self

Construct a fresh transcoding target from the provided seed.
Source§

impl<T, const S: char> Serialize for ConstPath<T, S>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: Write, const S: char> Transcode for ConstPath<T, S>

Source§

type Error = Error

The possible error when transcoding. Read more
Source§

fn transcode( &mut self, schema: &Schema, keys: impl IntoKeys, ) -> Result<(), DescendError<Self::Error>>

Perform a node lookup of a K: IntoKeys on a Schema and transcode it. Read more
Source§

impl<T: Copy, const S: char> Copy for ConstPath<T, S>

Source§

impl<T: Eq, const S: char> Eq for ConstPath<T, S>

Source§

impl<T, const S: char> StructuralPartialEq for ConstPath<T, S>

Auto Trait Implementations§

§

impl<T, const S: char> Freeze for ConstPath<T, S>
where T: Freeze,

§

impl<T, const S: char> RefUnwindSafe for ConstPath<T, S>
where T: RefUnwindSafe,

§

impl<T, const S: char> Send for ConstPath<T, S>
where T: Send,

§

impl<T, const S: char> Sync for ConstPath<T, S>
where T: Sync,

§

impl<T, const S: char> Unpin for ConstPath<T, S>
where T: Unpin,

§

impl<T, const S: char> UnwindSafe for ConstPath<T, S>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,