Skip to main content

Hashable

Trait Hashable 

Source
pub trait Hashable
where Self: TryIntoByteVec,
{ // Provided method fn try_hash( value: Arc<Self>, algorithm: HashAlgorithm, ) -> Result<Arc<Hash>, SerialiseError> { ... } }
Expand description

Hashable trait

Provided Methods§

Source

fn try_hash( value: Arc<Self>, algorithm: HashAlgorithm, ) -> Result<Arc<Hash>, SerialiseError>

Encodes this type using the specified Encoding.

§Parameters
  • value - The value to encode
  • encoding - The encoding to use when encoding this type.
§Returns

A Result containing the encoded string if successful, or a SerialiseError if an error occurs.

§Errors
  • SerialiseError - If the specified encoding is unsupported or an error occurs during serialisation.

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§