Struct symtern::adaptors::Inline
[−]
[src]
pub struct Inline<W> { /* fields omitted */ }
Interner optimized for short strings.
See the module-level documentation for more information.
Methods
impl<W> Inline<W>
[src]
Trait Implementations
impl<W: Copy> Copy for Inline<W>
[src]
impl<W: Clone> Clone for Inline<W>
[src]
fn clone(&self) -> Inline<W>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<W: Debug> Debug for Inline<W>
[src]
impl<W> Default for Inline<W> where W: Default
[src]
impl<W> From<W> for Inline<W>
[src]
fn from(w: W) -> Self
Performs the conversion.
impl<W> Len for Inline<W> where W: Len + Pool, W::Symbol::Id: Pack + ToPrimitive
[src]
fn len(&self) -> usize
Fetch the number of items contained in the pool. The returned value does not count values inlined in symbols.
fn is_empty(&self) -> bool
Check if the pool is "empty", i.e. has zero stored values.
Because strings inlined in symbols are not stored in the pool, they do not affect the result of this method.
fn is_full(&self) -> bool
Check if the number of interned symbols has reached the maximum allowed for the pool's ID type.
impl<'a, W, WS> Intern for &'a Inline<W> where W: Len + Pool<Symbol=WS>, &'a W: Intern<Input=str, Symbol=W::Symbol>, WS: Symbol, WS::Id: Pack
[src]
type Input = str
Type of value accepted by intern
.
type Symbol = Sym<WS>
Type used to represent interned values.
fn intern(self, s: &Self::Input) -> Result<Self::Symbol>
Fetch the symbol that corresponds to the given value. If the value does not map to any existing symbol, create and return a new one. This method may return an error if the interner encounters any error while storing the value. Read more
impl<'a, W, WS> Intern for &'a mut Inline<W> where W: Len + Pool<Symbol=WS>, &'a mut W: Intern<Input=str, Symbol=W::Symbol>, WS: Symbol, WS::Id: Pack
[src]
type Input = str
Type of value accepted by intern
.
type Symbol = Sym<WS>
Type used to represent interned values.
fn intern(self, s: &Self::Input) -> Result<Self::Symbol>
Fetch the symbol that corresponds to the given value. If the value does not map to any existing symbol, create and return a new one. This method may return an error if the interner encounters any error while storing the value. Read more
impl<'a, W, WS> Resolve for &'a Inline<W> where &'b W: Resolve<Input=WS, Output=&'b str>, WS: 'a + Symbol, WS::Id: Pack + SymbolId
[src]
type Input = &'a Sym<WS>
Type used to represent interned values.
type Output = &'a str
Type stored by the interner and made available with resolve
.
fn resolve(self, symbol: Self::Input) -> Result<Self::Output>
Look up and return a reference to the value represented by a symbol, or an error if the symbol was not found. Read more