Trait Internable

Source
trait Internable:
    Clone
    + Eq
    + Hash
    + 'static {
    // Required method
    fn intern_cache() -> &'static Mutex<TyIntern<Self>>;

    // Provided method
    fn intern(self) -> Interned<Self> { ... }
}
Expand description

Defines the behavior required for a type to be internable.

Types implementing this trait must provide access to a static cache and define an intern method that ensures values are stored uniquely.

Required Methods§

Source

fn intern_cache() -> &'static Mutex<TyIntern<Self>>

Provided Methods§

Source

fn intern(self) -> Interned<Self>

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.

Implementations on Foreign Types§

Source§

impl Internable for String

Source§

fn intern_cache() -> &'static Mutex<TyIntern<Self>>

Source§

impl Internable for Vec<String>

Source§

fn intern_cache() -> &'static Mutex<TyIntern<Self>>

Source§

impl Internable for PathBuf

Source§

fn intern_cache() -> &'static Mutex<TyIntern<Self>>

Implementors§