[][src]Struct muta_protocol::types::Hash

pub struct Hash(_);

Methods

impl Hash[src]

pub fn digest(bytes: Bytes) -> Self[src]

Enter an array of bytes to get a 32-bit hash. Note: sha3 is used for the time being and may be replaced with other hashing algorithms later.

pub fn from_empty() -> Self[src]

pub fn from_bytes(bytes: Bytes) -> ProtocolResult<Self>[src]

Converts the byte array to a Hash type. Note: if you want to compute the hash value of the byte array, you should call fn digest.

pub fn from_hex(s: &str) -> ProtocolResult<Self>[src]

pub fn as_bytes(&self) -> Bytes[src]

pub fn as_hex(&self) -> String[src]

Trait Implementations

impl Clone for Hash[src]

impl Debug for Hash[src]

impl Decodable for Hash[src]

impl Default for Hash[src]

impl<'de> Deserialize<'de> for Hash[src]

impl Encodable for Hash[src]

impl Eq for Hash[src]

impl FixedCodec for Hash[src]

impl From<Hash> for Hash[src]

impl From<Hash> for MerkleRoot[src]

impl Hash for Hash[src]

impl Ord for Hash[src]

impl PartialEq<Hash> for Hash[src]

impl PartialOrd<Hash> for Hash[src]

impl Serialize for Hash[src]

impl StructuralEq for Hash[src]

impl StructuralPartialEq for Hash[src]

impl TryFrom<Hash> for Hash[src]

type Error = ProtocolError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Hash

impl Send for Hash

impl Sync for Hash

impl Unpin for Hash

impl UnwindSafe for Hash

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ProtocolCodec for T where
    T: 'static + ProtocolCodecSync, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,