Trait bevy::utils::intern::Internable

pub trait Internable: Hash + Eq {
    // Required methods
    fn leak(&self) -> &'static Self;
    fn ref_eq(&self, other: &Self) -> bool;
    fn ref_hash<H>(&self, state: &mut H)
       where H: Hasher;
}
Expand description

A trait for internable values.

This is used by Interner<T> to create static references for values that are interned.

Required Methods§

fn leak(&self) -> &'static Self

Creates a static reference to self, possibly leaking memory.

fn ref_eq(&self, other: &Self) -> bool

Returns true if the two references point to the same value.

fn ref_hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds the reference to the hasher.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Internable for str

§

fn leak(&self) -> &'static str

§

fn ref_eq(&self, other: &str) -> bool

§

fn ref_hash<H>(&self, state: &mut H)
where H: Hasher,

Implementors§