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 Decodable for Midstate
impl Decodable for Midstate
§fn consensus_decode<D>(d: D) -> Result<Midstate, Error>where
D: Read,
fn consensus_decode<D>(d: D) -> Result<Midstate, Error>where
D: Read,
Decode an object with a well-defined format
§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 Encodable for Midstate
impl Encodable for Midstate
§fn consensus_encode<W>(&self, e: W) -> Result<usize, Error>where
W: Write,
fn consensus_encode<W>(&self, e: W) -> Result<usize, Error>where
W: Write,
Encode an object with a well-defined format, should only ever error if
the underlying
Write
errors. Returns the number of bytes written on
success§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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> Base32Len for T
impl<T> Base32Len for T
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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
§impl<T> CheckBase32<Vec<u5>> for T
impl<T> CheckBase32<Vec<u5>> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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
§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
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<T> ToBase32 for T
impl<T> ToBase32 for T
§fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
Encode as base32 and write it to the supplied writer
Implementations shouldn’t allocate.
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)