Struct twenty_first::shared_math::digest::Digest
source · pub struct Digest(pub [BFieldElement; 5]);
Tuple Fields§
§0: [BFieldElement; 5]
Implementations§
Trait Implementations§
source§impl BFieldCodec for Digest
impl BFieldCodec for Digest
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§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Digest
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Digest
Generate a random value of
T
, using rng
as the source of randomness.source§impl From<Digest> for RustyValue
impl From<Digest> for RustyValue
source§impl From<RustyValue> for Digest
impl From<RustyValue> for Digest
source§fn from(value: RustyValue) -> Self
fn from(value: RustyValue) -> Self
Converts to this type from the input type.
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
MerkleTree
s directly from XFieldElement
s.
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<Digest> for Digest
impl PartialEq<Digest> for Digest
source§impl PartialOrd<Digest> for Digest
impl PartialOrd<Digest> 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
source§impl TryFrom<Digest> for XFieldElement
impl TryFrom<Digest> for XFieldElement
impl Copy for Digest
impl Eq for Digest
impl StructuralEq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
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