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]) -> Self
pub const fn from_byte_array(inner: [u8; 32]) -> Self
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 FromHex for Midstate
impl FromHex for Midstate
Source§type Err = HexToArrayError
type Err = HexToArrayError
Error type returned while parsing hex string.
Source§fn from_byte_iter<I>(iter: I) -> Result<Self, Self::Err>
fn from_byte_iter<I>(iter: I) -> Result<Self, Self::Err>
Produces an object from a byte iterator.
Source§impl Ord for Midstate
impl Ord for Midstate
Source§impl PartialOrd for Midstate
impl PartialOrd for Midstate
impl Copy for Midstate
impl Eq for Midstate
impl StructuralPartialEq for Midstate
Auto Trait Implementations§
impl Freeze for Midstate
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