Trait internship::AllowIntern [] [src]

pub trait AllowIntern: Eq + Hash + ToOwned + Sealed + 'static {
    unsafe fn provide_per_thread_intern_pool(
    ) -> &'static LocalKey<RefCell<HashSet<Rc<Self>>>>; }

Common trait of intern-able types

This trait is sealed so you can't implement it on your own type.

Required Methods

Provide per-thread interned pool for this type.

This is necessary as Rust doesn't allow static variables with generic type, as this can't be monomorphized trivially.

This function is unsafe as Intern<T> relies on assumption that provided pool never be modified except for the construction/destruction of the Intern<T>.

Implementations on Foreign Types

impl AllowIntern for str
[src]

impl AllowIntern for [u8]
[src]

Implementors