Struct LeafIndex

Source
pub struct LeafIndex<const DEPTH: u8> { /* private fields */ }
Expand description

The index of a leaf, at a depth known at compile-time.

Implementations§

Source§

impl<const DEPTH: u8> LeafIndex<DEPTH>

Source

pub fn new(value: u64) -> Result<LeafIndex<DEPTH>, MerkleError>

Source

pub fn value(&self) -> u64

Source§

impl LeafIndex<miden_crypto::::merkle::smt::{impl#2}::{constant#0}>

Source

pub const fn new_max_depth( value: u64, ) -> LeafIndex<miden_crypto::::merkle::smt::{impl#2}::{constant#0}>

Trait Implementations§

Source§

impl<const DEPTH: u8> Clone for LeafIndex<DEPTH>

Source§

fn clone(&self) -> LeafIndex<DEPTH>

Returns a copy 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<const DEPTH: u8> Debug for LeafIndex<DEPTH>

Source§

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

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

impl<const DEPTH: u8> Default for LeafIndex<DEPTH>

Source§

fn default() -> LeafIndex<DEPTH>

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

impl<const DEPTH: u8> Deserializable for LeafIndex<DEPTH>

Source§

fn read_from<R>( source: &mut R, ) -> Result<LeafIndex<DEPTH>, DeserializationError>
where R: ByteReader,

Reads a sequence of bytes from the provided source, attempts to deserialize these bytes into Self, and returns the result. Read more
Source§

fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>

Attempts to deserialize the provided bytes into Self and returns the result. Read more
Source§

impl From<&RpoDigest> for LeafIndex<miden_crypto::::merkle::smt::full::{impl#5}::{constant#0}>

Source§

fn from( value: &RpoDigest, ) -> LeafIndex<miden_crypto::::merkle::smt::full::{impl#5}::{constant#0}>

Converts to this type from the input type.
Source§

impl From<[BaseElement; 4]> for LeafIndex<miden_crypto::::merkle::smt::full::{impl#3}::{constant#0}>

Source§

fn from( value: [BaseElement; 4], ) -> LeafIndex<miden_crypto::::merkle::smt::full::{impl#3}::{constant#0}>

Converts to this type from the input type.
Source§

impl<const DEPTH: u8> From<LeafIndex<DEPTH>> for NodeIndex

Source§

fn from(value: LeafIndex<DEPTH>) -> NodeIndex

Converts to this type from the input type.
Source§

impl From<RpoDigest> for LeafIndex<miden_crypto::::merkle::smt::full::{impl#4}::{constant#0}>

Source§

fn from( value: RpoDigest, ) -> LeafIndex<miden_crypto::::merkle::smt::full::{impl#4}::{constant#0}>

Converts to this type from the input type.
Source§

impl<const DEPTH: u8> Hash for LeafIndex<DEPTH>

Source§

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

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<const DEPTH: u8> Ord for LeafIndex<DEPTH>

Source§

fn cmp(&self, other: &LeafIndex<DEPTH>) -> 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<const DEPTH: u8> PartialEq for LeafIndex<DEPTH>

Source§

fn eq(&self, other: &LeafIndex<DEPTH>) -> 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<const DEPTH: u8> PartialOrd for LeafIndex<DEPTH>

Source§

fn partial_cmp(&self, other: &LeafIndex<DEPTH>) -> 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<const DEPTH: u8> Serializable for LeafIndex<DEPTH>

Source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

Serializes self into bytes and writes these bytes into the target.
Source§

fn to_bytes(&self) -> Vec<u8>

Serializes self into a vector of bytes.
Source§

fn get_size_hint(&self) -> usize

Returns an estimate of how many bytes are needed to represent self. Read more
Source§

impl<const DEPTH: u8> TryFrom<NodeIndex> for LeafIndex<DEPTH>

Source§

type Error = MerkleError

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

fn try_from( node_index: NodeIndex, ) -> Result<LeafIndex<DEPTH>, <LeafIndex<DEPTH> as TryFrom<NodeIndex>>::Error>

Performs the conversion.
Source§

impl<const DEPTH: u8> Copy for LeafIndex<DEPTH>

Source§

impl<const DEPTH: u8> Eq for LeafIndex<DEPTH>

Source§

impl<const DEPTH: u8> StructuralPartialEq for LeafIndex<DEPTH>

Auto Trait Implementations§

§

impl<const DEPTH: u8> Freeze for LeafIndex<DEPTH>

§

impl<const DEPTH: u8> RefUnwindSafe for LeafIndex<DEPTH>

§

impl<const DEPTH: u8> Send for LeafIndex<DEPTH>

§

impl<const DEPTH: u8> Sync for LeafIndex<DEPTH>

§

impl<const DEPTH: u8> Unpin for LeafIndex<DEPTH>

§

impl<const DEPTH: u8> UnwindSafe for LeafIndex<DEPTH>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V