Struct Track

Source
pub struct Track<K> { /* private fields */ }
Expand description

Track key depth

This tracks the depth during Keys and Transcode.

Implementations§

Source§

impl<K> Track<K>

Source

pub fn new(inner: K) -> Self

Create a new Track

Source

pub fn depth(&self) -> usize

Whether a leaf node as been encountered

Source

pub fn inner(&self) -> &K

Borrow the inner Keys

Source

pub fn into_inner(self) -> (K, usize)

Split into inner Keys and leaf node flag

Trait Implementations§

Source§

impl<K: Clone> Clone for Track<K>

Source§

fn clone(&self) -> Track<K>

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<K: Debug> Debug for Track<K>

Source§

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

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

impl<K: Default> Default for Track<K>

Source§

fn default() -> Track<K>

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

impl<K: Hash> Hash for Track<K>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<K: Keys> IntoKeys for &mut Track<K>

Source§

type IntoKeys = &mut Track<K>

The specific Keys implementor.
Source§

fn into_keys(self) -> Self::IntoKeys

Convert self into a Keys implementor.
Source§

impl<K: Keys> Keys for Track<K>

Source§

fn next(&mut self, internal: &Internal) -> Result<usize, KeyError>

Look up the next key in a Internal and convert to usize index. Read more
Source§

fn finalize(&mut self) -> Result<(), KeyError>

Finalize the keys, ensure there are no more. Read more
Source§

fn chain<U: IntoKeys>(self, other: U) -> Chain<Self, U::IntoKeys>
where Self: Sized,

Chain another Keys to this one.
Source§

fn track(self) -> Track<Self>
where Self: Sized,

Track depth
Source§

fn short(self) -> Short<Self>
where Self: Sized,

Track whether a leaf node is reached
Source§

impl<K: PartialEq> PartialEq for Track<K>

Source§

fn eq(&self, other: &Track<K>) -> 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<K: PartialOrd> PartialOrd for Track<K>

Source§

fn partial_cmp(&self, other: &Track<K>) -> 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<K> Serialize for Track<K>
where K: 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: Transcode> Transcode for Track<T>

Source§

type Error = <T as Transcode>::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<K> StructuralPartialEq for Track<K>

Auto Trait Implementations§

§

impl<K> Freeze for Track<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for Track<K>
where K: RefUnwindSafe,

§

impl<K> Send for Track<K>
where K: Send,

§

impl<K> Sync for Track<K>
where K: Sync,

§

impl<K> Unpin for Track<K>
where K: Unpin,

§

impl<K> UnwindSafe for Track<K>
where K: 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.