Internable in bootstrap::utils::cache - Rust
Description: Defines the behavior required for a type to be internable.

Skip to main content

## Internable

# 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".

## Implementations on Foreign Types§

Source§

### impl Internable for String

Source§

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

## Implementors§