Struct coins_core::hashes::Hash256Digest
source · pub struct Hash256Digest(/* private fields */);
Expand description
A bitcoin-style Hash256
Implementations§
source§impl Hash256Digest
impl Hash256Digest
sourcepub fn to_internal(self) -> DigestOutput<Hash256>
pub fn to_internal(self) -> DigestOutput<Hash256>
Unwrap the marked digest, returning the underlying GenericArray
Trait Implementations§
source§impl AsMut<[u8]> for Hash256Digest
impl AsMut<[u8]> for Hash256Digest
source§impl AsMut<GenericArray<u8, <Hash256 as OutputSizeUser>::OutputSize>> for Hash256Digest
impl AsMut<GenericArray<u8, <Hash256 as OutputSizeUser>::OutputSize>> for Hash256Digest
source§fn as_mut(&mut self) -> &mut DigestOutput<Hash256>
fn as_mut(&mut self) -> &mut DigestOutput<Hash256>
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsRef<[u8]> for Hash256Digest
impl AsRef<[u8]> for Hash256Digest
source§impl AsRef<GenericArray<u8, <Hash256 as OutputSizeUser>::OutputSize>> for Hash256Digest
impl AsRef<GenericArray<u8, <Hash256 as OutputSizeUser>::OutputSize>> for Hash256Digest
source§fn as_ref(&self) -> &DigestOutput<Hash256>
fn as_ref(&self) -> &DigestOutput<Hash256>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl ByteFormat for Hash256Digest
impl ByteFormat for Hash256Digest
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the byte-length of the serialized data structure.
source§fn read_from<R>(reader: &mut R) -> SerResult<Self>
fn read_from<R>(reader: &mut R) -> SerResult<Self>
Deserializes an instance of
Self
from a std::io::Read
.
The limit
argument is used only when deserializing collections, and specifies a maximum
number of instances of the underlying type to read. Read moresource§fn write_to<W>(&self, writer: &mut W) -> SerResult<usize>where
W: Write,
fn write_to<W>(&self, writer: &mut W) -> SerResult<usize>where
W: Write,
Serializes
self
to a std::io::Write
. Following Write
trait conventions, its Ok
type must be a usize
denoting the number of bytes written. Read moresource§fn read_seq_from<R>(
reader: &mut R,
mode: ReadSeqMode,
) -> Result<Vec<Self>, Self::Error>
fn read_seq_from<R>( reader: &mut R, mode: ReadSeqMode, ) -> Result<Vec<Self>, Self::Error>
Read a sequence of objects from the reader. The mode argument specifies
how many objects to read.
source§fn write_seq_to<'a, W, E, Iter, Item>(
writer: &mut W,
iter: Iter,
) -> Result<usize, <Self as ByteFormat>::Error>
fn write_seq_to<'a, W, E, Iter, Item>( writer: &mut W, iter: Iter, ) -> Result<usize, <Self as ByteFormat>::Error>
Write a sequence of
ByteFormat
objects to a writer. The iter
argument may be any object that implements
IntoIterator<Item = &Item>
. This means we can seamlessly use vectors,
slices, etc. Read moresource§fn deserialize_hex(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
fn deserialize_hex(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
Decodes a hex string to a
Vec<u8>
, deserializes an instance of Self
from that vector.source§fn deserialize_base64(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
fn deserialize_base64(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
Serialize
self
to a base64 string, using standard RFC4648 non-url safe characterssource§fn serialize_hex(&self) -> String
fn serialize_hex(&self) -> String
Serializes
self
to a vector, returns the hex-encoded vectorsource§fn serialize_base64(&self) -> String
fn serialize_base64(&self) -> String
Serialize
self
to a base64 string, using standard RFC4648 non-url safe characterssource§impl Clone for Hash256Digest
impl Clone for Hash256Digest
source§fn clone(&self) -> Hash256Digest
fn clone(&self) -> Hash256Digest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Hash256Digest
impl Debug for Hash256Digest
source§impl Default for Hash256Digest
impl Default for Hash256Digest
source§fn default() -> Hash256Digest
fn default() -> Hash256Digest
Returns the “default value” for a type. Read more
source§impl<T> From<T> for Hash256Digest
impl<T> From<T> for Hash256Digest
source§impl Hash for Hash256Digest
impl Hash for Hash256Digest
source§impl MarkedDigest<Hash256Digest> for Hash256
impl MarkedDigest<Hash256Digest> for Hash256
source§fn finalize_marked(self) -> Hash256Digest
fn finalize_marked(self) -> Hash256Digest
Produce a marked digest from the hasher
source§fn digest_marked(data: &[u8]) -> Hash256Digest
fn digest_marked(data: &[u8]) -> Hash256Digest
Shortcut to produce a marked digest
source§impl MarkedDigestOutput for Hash256Digest
impl MarkedDigestOutput for Hash256Digest
source§fn from_be_hex(be: &str) -> SerResult<Self>
fn from_be_hex(be: &str) -> SerResult<Self>
Deserialize to BE hex
source§fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Use as a mutable slice
source§impl Ord for Hash256Digest
impl Ord for Hash256Digest
source§fn cmp(&self, other: &Hash256Digest) -> Ordering
fn cmp(&self, other: &Hash256Digest) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Hash256Digest
impl PartialEq for Hash256Digest
source§fn eq(&self, other: &Hash256Digest) -> bool
fn eq(&self, other: &Hash256Digest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Hash256Digest
impl PartialOrd for Hash256Digest
source§fn partial_cmp(&self, other: &Hash256Digest) -> Option<Ordering>
fn partial_cmp(&self, other: &Hash256Digest) -> Option<Ordering>
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 Hash256Digest
impl Eq for Hash256Digest
impl StructuralPartialEq for Hash256Digest
Auto Trait Implementations§
impl Freeze for Hash256Digest
impl RefUnwindSafe for Hash256Digest
impl Send for Hash256Digest
impl Sync for Hash256Digest
impl Unpin for Hash256Digest
impl UnwindSafe for Hash256Digest
Blanket Implementations§
source§impl<T> Base32Len for T
impl<T> Base32Len for T
source§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
source§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,
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
)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> ToBase32 for T
impl<T> ToBase32 for T
source§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>,
👎Deprecated: use
ToHexExt
insteadEncode 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>,
👎Deprecated: use
ToHexExt
insteadEncode the hex strict representing
self
into the result.
Upper case letters are used (e.g. F9B4CA
).source§impl<T> ToHexExt for T
impl<T> ToHexExt for T
source§fn encode_hex(&self) -> String
fn encode_hex(&self) -> String
Encode the hex strict representing
self
into the result.
Lower case letters are used (e.g. f9b4ca
).source§fn encode_hex_upper(&self) -> String
fn encode_hex_upper(&self) -> String
Encode the hex strict representing
self
into the result.
Upper case letters are used (e.g. F9B4CA
).source§fn encode_hex_with_prefix(&self) -> String
fn encode_hex_with_prefix(&self) -> String
Encode the hex strict representing
self
into the result with prefix 0x
.
Lower case letters are used (e.g. 0xf9b4ca
).source§fn encode_hex_upper_with_prefix(&self) -> String
fn encode_hex_upper_with_prefix(&self) -> String
Encode the hex strict representing
self
into the result with prefix 0X
.
Upper case letters are used (e.g. 0xF9B4CA
).