Trait Digest

Source
pub trait Digest: Display {
    // Provided methods
    fn as_bytes(&self) -> &[u8] 
       where Self: AsRef<[u8]> { ... }
    fn to_hex_lowercase(&self) -> String
       where Self: LowerHex { ... }
    fn to_hex_uppercase(&self) -> String
       where Self: UpperHex { ... }
}
Expand description

A trait for hash digests.

Provided Methods§

Source

fn as_bytes(&self) -> &[u8]
where Self: AsRef<[u8]>,

Returns a byte slice of the digest’s contents.

Source

fn to_hex_lowercase(&self) -> String
where Self: LowerHex,

Returns a string in the lowercase hexadecimal representation.

Source

fn to_hex_uppercase(&self) -> String
where Self: UpperHex,

Returns a string in the uppercase hexadecimal representation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§