Struct bitcoin_hashes::sha256::Midstate
source · 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
§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 PartialEq for Midstate
impl PartialEq for Midstate
source§impl PartialOrd for Midstate
impl PartialOrd 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 moreimpl 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)