holo_hash::hash_type

Trait PrimitiveHashType

Source
pub trait PrimitiveHashType: HashType {
    // Required methods
    fn new() -> Self;
    fn static_prefix() -> &'static [u8] ;
    fn hash_name(self) -> &'static str;
}
Expand description

A PrimitiveHashType is one with a multihash prefix. In contrast, a non-primitive hash type could be one of several primitive types, e.g. an AnyDhtHash can represent one of three primitive types.

Required Methods§

Source

fn new() -> Self

Constructor

Source

fn static_prefix() -> &'static [u8]

Get the 3 byte prefix, which is statically known for primitive hash types

Source

fn hash_name(self) -> &'static str

Get a Display-worthy name for this hash type

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§