Struct duniter_documents::Hash
[−]
[src]
pub struct Hash(pub [u8; 32]);
A hash wrapper.
A hash is often provided as string composed of 64 hexadecimal character (0 to 9 then A to F).
Methods
impl Hash
[src]
pub fn to_hex(&self) -> String
[src]
Convert a Hash
to an hex string.
pub fn from_hex(text: &str) -> Result<Hash, BaseConvertionError>
[src]
Convert a hex string in a Hash
.
The hex string must only contains hex characters and produce a 32 bytes value.
Trait Implementations
impl Copy for Hash
[src]
impl Clone for Hash
[src]
fn clone(&self) -> Hash
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Hash
[src]
fn eq(&self, __arg_0: &Hash) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Hash) -> bool
[src]
This method tests for !=
.
impl Eq for Hash
[src]
impl Hash for Hash
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for Hash
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl Debug for Hash
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more