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<Digest, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Digest, Error>
Generate an arbitrary value of
Self from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Digest, Error>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Digest, Error>
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<Digest>, <Digest as BFieldCodec>::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<Digest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Digest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<XFieldElement> for Digest
impl From<XFieldElement> for Digest
source§fn from(xfe: XFieldElement) -> Digest
fn from(xfe: XFieldElement) -> Digest
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 Serialize for Digest
impl Serialize for Digest
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§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§fn try_from(
value: &[BFieldElement]
) -> Result<Digest, <Digest as TryFrom<&[BFieldElement]>>::Error>
fn try_from( value: &[BFieldElement] ) -> Result<Digest, <Digest as TryFrom<&[BFieldElement]>>::Error>
Performs the conversion.
source§impl TryFrom<Digest> for XFieldElement
impl TryFrom<Digest> for XFieldElement
§type Error = TryFromXFieldElementError
type Error = TryFromXFieldElementError
The type returned in the event of a conversion error.
source§fn try_from(
digest: Digest
) -> Result<XFieldElement, <XFieldElement as TryFrom<Digest>>::Error>
fn try_from( digest: Digest ) -> Result<XFieldElement, <XFieldElement as TryFrom<Digest>>::Error>
Performs the conversion.
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