Skip to main content

HashComponent

Trait HashComponent 

Source
pub trait HashComponent {
    // Required method
    fn hash_component(&self, hasher: &mut ComponentHasher);

    // Provided method
    fn compute_hash(&self) -> i32 { ... }
}
Expand description

Trait for types that can be hashed for component validation.

Required Methods§

Source

fn hash_component(&self, hasher: &mut ComponentHasher)

Hashes this value into the given hasher.

Provided Methods§

Source

fn compute_hash(&self) -> i32

Computes the hash of this value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HashComponent for ()

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for String

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for TextComponent

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for bool

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for f32

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for f64

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for i8

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for i16

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for i32

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for i64

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for str

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Source§

impl HashComponent for u8

Source§

fn hash_component(&self, hasher: &mut ComponentHasher)

Implementors§