pub struct InterningTable<T> { /* private fields */ }Expand description
An interning table storing unique values of T and assigning them stable indices.
This type is primarily an implementation detail behind Interned<T> and
the Internable trait. You typically won’t use it directly unless you’re
wiring up a new globally‑interned type.
Implementations§
Source§impl<T: Hash + Eq + Clone + Send> InterningTable<T>
impl<T: Hash + Eq + Clone + Send> InterningTable<T>
Sourcepub const fn new_with_values<const N: usize>(
values: fn() -> [T; N],
) -> (LazyLockNewWithValue<T, N>, [Interned<T>; N])
pub const fn new_with_values<const N: usize>( values: fn() -> [T; N], ) -> (LazyLockNewWithValue<T, N>, [Interned<T>; N])
Creates a global LazyLock interning table prepopulated with values,
and returns both the lock and the corresponding Interned<T> handles.
§Panics
Panics if values contains duplicates (by Eq) or if N is greater
than u32::MAX.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for InterningTable<T>
impl<T> RefUnwindSafe for InterningTable<T>where
T: RefUnwindSafe,
impl<T> Send for InterningTable<T>where
T: Send,
impl<T> Sync for InterningTable<T>where
T: Sync,
impl<T> Unpin for InterningTable<T>where
T: Unpin,
impl<T> UnsafeUnpin for InterningTable<T>
impl<T> UnwindSafe for InterningTable<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more