Struct Midstate
pub struct Midstate(pub [u8; 32]);
Expand description
Output of the SHA256 hash function.
Tuple Fields§
§0: [u8; 32]
Implementations§
§impl Midstate
impl Midstate
pub 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.
pub 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.
pub 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§
§impl<'de> Deserialize<'de> for Midstate
impl<'de> Deserialize<'de> for Midstate
§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
§impl<I> Index<I> for Midstatewhere
I: SliceIndex<[u8]>,
impl<I> Index<I> for Midstatewhere
I: SliceIndex<[u8]>,
§impl Ord for Midstate
impl Ord for Midstate
§impl PartialOrd for Midstate
impl PartialOrd for Midstate
§impl SerdeHash for Midstate
impl SerdeHash for Midstate
§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.
§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.
§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.
§impl Serialize for Midstate
impl Serialize for Midstate
§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 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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more