pub trait Internable:
Sized
+ Hash
+ Eq
+ Clone
+ Send
+ 'static {
// Required method
fn interning_table() -> &'static Mutex<InterningTable<Self>>;
// Provided method
fn intern(&self) -> Interned<Self> { ... }
}Expand description
Types that have a single, process‑global interning table.
Implement this for your type to opt in to interning:
provide a static (usually a LazyLock<Mutex<InterningTable<Self>>>)
and return a reference to it.
Required Methods§
Sourcefn interning_table() -> &'static Mutex<InterningTable<Self>>
fn interning_table() -> &'static Mutex<InterningTable<Self>>
Returns the global interning table for Self.
Provided Methods§
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.