Struct InternedStore

pub(in ::bridge) struct InternedStore<T: 'static> { pub(in ::bridge::handle) owned: OwnedStore<T>, pub(in ::bridge::handle) interner: HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>> }

Like OwnedStore, but avoids storing any value more than once.

Fields

owned: OwnedStore<T>
interner: HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>

Implementations

impl<T: Copy + Eq + Hash> InternedStore<T>

fn new(counter: &'static AtomicU32) -> Self
fn alloc(&mut self, x: T) -> NonZero<u32>
fn copy(&mut self, h: NonZero<u32>) -> T

Auto Trait Implementations

impl<T> Freeze for InternedStore<T> where OwnedStore<T>: Freeze, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: Freeze,

impl<T> RefUnwindSafe for InternedStore<T> where OwnedStore<T>: RefUnwindSafe, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: RefUnwindSafe,

impl<T> Send for InternedStore<T> where OwnedStore<T>: Send, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: Send,

impl<T> Sync for InternedStore<T> where OwnedStore<T>: Sync, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: Sync,

impl<T> Unpin for InternedStore<T> where OwnedStore<T>: Unpin, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: Unpin,

impl<T> UnsafeUnpin for InternedStore<T> where OwnedStore<T>: UnsafeUnpin, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: UnsafeUnpin,

impl<T> UnwindSafe for InternedStore<T> where OwnedStore<T>: UnwindSafe, HashMap<T, NonZero<u32>, BuildHasherDefault<FxHasher>>: UnwindSafe,

Blanket Implementations

impl<T> Any for InternedStore<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for InternedStore<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for InternedStore<T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for InternedStore<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for InternedStore<T> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for InternedStore<T>

impl<T, U> Into<U> for InternedStore<T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for InternedStore<T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for InternedStore<T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>