Struct twenty_first::math::digest::Digest
source · pub struct Digest(pub [BFieldElement; 5]);Tuple Fields§
§0: [BFieldElement; 5]Implementations§
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Digest
impl<'arbitrary> Arbitrary<'arbitrary> for Digest
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moresource§impl BFieldCodec for Digest
impl BFieldCodec for Digest
type Error = DigestBFieldDecodingError
fn decode(sequence: &[BFieldElement]) -> Result<Box<Self>, Self::Error>
fn encode(&self) -> Vec<BFieldElement>
source§fn static_length() -> Option<usize>
fn static_length() -> Option<usize>
Returns the length in number of BFieldElements if it is known at compile-time.
Otherwise, None.
source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Distribution<Digest> for Standard
impl Distribution<Digest> for Standard
source§impl From<XFieldElement> for Digest
impl From<XFieldElement> for Digest
source§fn from(xfe: XFieldElement) -> Self
fn from(xfe: XFieldElement) -> Self
Interpret the XFieldElement as a Digest. No hashing is performed. This
interpretation can be useful for the
AlgebraicHasher trait and,
by extension, allows building
MerkleTrees directly from XFieldElements.
source§impl GetSize for Digest
impl GetSize for Digest
source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
source§impl Ord for Digest
impl Ord for Digest
source§impl PartialEq for Digest
impl PartialEq for Digest
source§impl PartialOrd for Digest
impl PartialOrd for Digest
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl TryFrom<&[BFieldElement]> for Digest
impl TryFrom<&[BFieldElement]> for Digest
§type Error = TryFromDigestError
type Error = TryFromDigestError
The type returned in the event of a conversion error.
source§impl TryFrom<Digest> for XFieldElement
impl TryFrom<Digest> for XFieldElement
source§impl TryFrom<Vec<BFieldElement>> for Digest
impl TryFrom<Vec<BFieldElement>> for Digest
§type Error = TryFromDigestError
type Error = TryFromDigestError
The type returned in the event of a conversion error.
impl Copy for Digest
impl Eq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnwindSafe for Digest
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> 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