pub struct Midstate(pub [u8; 32]);
Expand description
Output of the SHA256 hash function.
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl Midstate
impl Midstate
sourcepub const fn from_byte_array(inner: [u8; 32]) -> Midstate
pub const fn from_byte_array(inner: [u8; 32]) -> Midstate
Construct a new Midstate
from the inner value.
sourcepub fn from_slice(sl: &[u8]) -> Result<Midstate, FromSliceError>
pub fn from_slice(sl: &[u8]) -> Result<Midstate, FromSliceError>
Copies a byte slice into the Midstate
object.
sourcepub fn to_byte_array(self) -> [u8; 32]
pub fn to_byte_array(self) -> [u8; 32]
Unwraps the Midstate
and returns the underlying byte array.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Midstate
impl<'de> Deserialize<'de> for Midstate
source§fn deserialize<D>(d: D) -> Result<Midstate, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Midstate, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Midstate
impl Ord for Midstate
source§impl PartialEq<Midstate> for Midstate
impl PartialEq<Midstate> for Midstate
source§impl PartialOrd<Midstate> for Midstate
impl PartialOrd<Midstate> for Midstate
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 SerdeHash for Midstate
impl SerdeHash for Midstate
source§fn from_slice_delegated(sl: &[u8]) -> Result<Midstate, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Midstate, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
source§fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, s: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Do serde serialization.
source§fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Do serde deserialization.
source§impl Serialize for Midstate
impl Serialize for Midstate
source§fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, s: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Midstate
impl Eq for Midstate
impl StructuralEq for Midstate
impl StructuralPartialEq for Midstate
Auto Trait Implementations§
impl RefUnwindSafe for Midstate
impl Send for Midstate
impl Sync for Midstate
impl Unpin for Midstate
impl UnwindSafe for Midstate
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