Trait pthash::hashing::Hashable

source ·
pub trait Hashable {
    type Bytes<'a>: AsRef<[u8]>
       where Self: 'a;

    // Required method
    fn as_bytes(&self) -> Self::Bytes<'_>;
}
Expand description

Trait of types which can be hashed with PTHash perfect hash functions.

Required Associated Types§

source

type Bytes<'a>: AsRef<[u8]> where Self: 'a

Required Methods§

source

fn as_bytes(&self) -> Self::Bytes<'_>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Hashable for u64

§

type Bytes<'a> = [u8; 8] where Self: 'a

source§

fn as_bytes(&self) -> Self::Bytes<'_>

source§

impl Hashable for [u8]

§

type Bytes<'a> = &'a [u8]

source§

fn as_bytes(&self) -> Self::Bytes<'_>

source§

impl<'a, T: Hashable + ?Sized> Hashable for &'a T

§

type Bytes<'b> = <T as Hashable>::Bytes<'b> where Self: 'b

source§

fn as_bytes(&self) -> Self::Bytes<'_>

Implementors§