pub struct HashSetCell {
pub value: [u8; 32],
pub sequence_number: Option<usize>,
}
Fields§
§value: [u8; 32]
§sequence_number: Option<usize>
Implementations§
Source§impl HashSetCell
impl HashSetCell
Sourcepub fn value_bytes(&self) -> [u8; 32]
pub fn value_bytes(&self) -> [u8; 32]
Returns the value as a byte array.
Sourcepub fn value_biguint(&self) -> BigUint
pub fn value_biguint(&self) -> BigUint
Returns the value as a big number.
Sourcepub fn sequence_number(&self) -> Option<usize>
pub fn sequence_number(&self) -> Option<usize>
Returns the associated sequence number.
Sourcepub fn is_valid(&self, current_sequence_number: usize) -> bool
pub fn is_valid(&self, current_sequence_number: usize) -> bool
Checks whether the value is valid according to the provided
current_sequence_number
(which usually should be a sequence number
associated with the Merkle tree).
The value is valid if:
- It was not annotated with sequence number.
- Its sequence number is lower than the provided
sequence_number
.
The value is invalid if it’s lower or equal to the provided
sequence_number
.
Trait Implementations§
Source§impl Clone for HashSetCell
impl Clone for HashSetCell
Source§fn clone(&self) -> HashSetCell
fn clone(&self) -> HashSetCell
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HashSetCell
impl Debug for HashSetCell
Source§impl Ord for HashSetCell
impl Ord for HashSetCell
Source§fn cmp(&self, other: &HashSetCell) -> Ordering
fn cmp(&self, other: &HashSetCell) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for HashSetCell
impl PartialEq for HashSetCell
Source§impl PartialOrd for HashSetCell
impl PartialOrd for HashSetCell
impl Copy for HashSetCell
impl Eq for HashSetCell
impl Send for HashSetCell
impl StructuralPartialEq for HashSetCell
Auto Trait Implementations§
impl Freeze for HashSetCell
impl RefUnwindSafe for HashSetCell
impl Sync for HashSetCell
impl Unpin for HashSetCell
impl UnwindSafe for HashSetCell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more