Struct TypedInterner

Source
pub struct TypedInterner<Key, T> { /* private fields */ }

Implementations§

Source§

impl<K, T> TypedInterner<K, T>

Source

pub fn new(interner: T) -> Self

Source

pub fn into_inner(self) -> T

Trait Implementations§

Source§

impl<Key: Debug, T: Debug> Debug for TypedInterner<Key, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Key, T> GetStr for TypedInterner<Key, T>
where T: GetStr, Key: Into<T::Key>,

Source§

type Key = Key

Key type used to fetch a string.
Source§

fn get(&self, k: Key) -> Result<&str>

Get the string associated with key k.
Source§

fn len(&self) -> usize

Total number of strings interned.
Source§

fn str_len(&self) -> usize

Size of interned strings.
Source§

fn is_empty(&self) -> bool

true if len is 0.
Source§

impl<Key, T> InternStr for TypedInterner<Key, T>
where T: InternStr, T::Key: Into<Key>,

Source§

type Key = Key

Key type returned from intern, can be used to fetch string later.
Source§

fn intern<U: AsRef<str>>(&mut self, s: U) -> Result<Key>

Intern string s and return a key that can be used to retrieve it later.

Auto Trait Implementations§

§

impl<Key, T> Freeze for TypedInterner<Key, T>
where T: Freeze,

§

impl<Key, T> RefUnwindSafe for TypedInterner<Key, T>

§

impl<Key, T> Send for TypedInterner<Key, T>
where T: Send, Key: Send,

§

impl<Key, T> Sync for TypedInterner<Key, T>
where T: Sync, Key: Sync,

§

impl<Key, T> Unpin for TypedInterner<Key, T>
where T: Unpin, Key: Unpin,

§

impl<Key, T> UnwindSafe for TypedInterner<Key, T>
where T: UnwindSafe, Key: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.