Struct coins_core::hashes::Hash160Digest

source ·
pub struct Hash160Digest(/* private fields */);
Expand description

A bitcoin-style Hash160

Implementations§

source§

impl Hash160Digest

source

pub fn to_internal(self) -> DigestOutput<Hash160>

Unwrap the marked digest, returning the underlying GenericArray

Trait Implementations§

source§

impl AsMut<[u8]> for Hash160Digest

source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsMut<GenericArray<u8, <Hash160 as OutputSizeUser>::OutputSize>> for Hash160Digest

source§

fn as_mut(&mut self) -> &mut DigestOutput<Hash160>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<[u8]> for Hash160Digest

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<GenericArray<u8, <Hash160 as OutputSizeUser>::OutputSize>> for Hash160Digest

source§

fn as_ref(&self) -> &DigestOutput<Hash160>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl ByteFormat for Hash160Digest

§

type Error = SerError

An associated error type
source§

fn serialized_length(&self) -> usize

Returns the byte-length of the serialized data structure.
source§

fn read_from<R>(reader: &mut R) -> SerResult<Self>
where R: Read, Self: Sized,

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 more
source§

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 more
source§

fn read_seq_from<R>( reader: &mut R, mode: ReadSeqMode, ) -> Result<Vec<Self>, Self::Error>
where R: Read, Self: Sized,

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>
where W: Write, E: Into<Self::Error> + From<SerError> + From<IOError> + Error, Item: 'a + ByteFormat<Error = E>, Iter: IntoIterator<Item = &'a Item>,

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 more
source§

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,

Serialize self to a base64 string, using standard RFC4648 non-url safe characters
source§

fn serialize_hex(&self) -> String

Serializes self to a vector, returns the hex-encoded vector
source§

fn serialize_base64(&self) -> String

Serialize self to a base64 string, using standard RFC4648 non-url safe characters
source§

impl Clone for Hash160Digest

source§

fn clone(&self) -> Hash160Digest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Hash160Digest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Hash160Digest

source§

fn default() -> Hash160Digest

Returns the “default value” for a type. Read more
source§

impl<T> From<T> for Hash160Digest

source§

fn from(t: T) -> Self

Converts to this type from the input type.
source§

impl Hash for Hash160Digest

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl MarkedDigest<Hash160Digest> for Hash160

source§

fn finalize_marked(self) -> Hash160Digest

Produce a marked digest from the hasher
source§

fn digest_marked(data: &[u8]) -> Hash160Digest

Shortcut to produce a marked digest
source§

impl MarkedDigestOutput for Hash160Digest

source§

fn size(&self) -> usize

Returns the number of bytes in the digest
source§

fn reversed(&self) -> Self

Return a clone in opposite byte order
source§

fn from_be_hex(be: &str) -> SerResult<Self>

Deserialize to BE hex
source§

fn to_be_hex(&self) -> String

Convert to BE hex
source§

fn as_mut_slice(&mut self) -> &mut [u8]

Use as a mutable slice
source§

fn as_slice(&self) -> &[u8]

Use as a slice
source§

impl Ord for Hash160Digest

source§

fn cmp(&self, other: &Hash160Digest) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Hash160Digest

source§

fn eq(&self, other: &Hash160Digest) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Hash160Digest

source§

fn partial_cmp(&self, other: &Hash160Digest) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Hash160Digest

source§

impl Eq for Hash160Digest

source§

impl StructuralPartialEq for Hash160Digest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Base32Len for T
where T: AsRef<[u8]>,

source§

fn base32_len(&self) -> usize

Calculate the base32 serialized length
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckBase32<Vec<u5>> for T
where T: AsRef<[u8]>,

§

type Err = Error

Error type if conversion fails
source§

fn check_base32(self) -> Result<Vec<u5>, <T as CheckBase32<Vec<u5>>>::Err>

Check if all values are in range and return array-like struct of u5 values
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToBase32 for T
where T: AsRef<[u8]>,

source§

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§

fn to_base32(&self) -> Vec<u5>

Convert Self to base32 vector
source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

👎Deprecated: use ToHexExt instead
Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca).
source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

👎Deprecated: use ToHexExt instead
Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA).
source§

impl<T> ToHexExt for T
where T: AsRef<[u8]>,

source§

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

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

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

Encode the hex strict representing self into the result with prefix 0X. Upper case letters are used (e.g. 0xF9B4CA).
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.