Trait lasso::Resolver[][src]

pub trait Resolver<K = Spur> {
    fn resolve<'a>(&'a self, key: &K) -> &'a str;
fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>;
unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str;
fn contains_key(&self, key: &K) -> bool;
fn len(&self) -> usize; fn is_empty(&self) -> bool { ... } }
Expand description

A generic interface that allows using any underlying interner only for its resolution capabilities, allowing only key -> str lookups

Required methods

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

Resolves the given key into a string

Panics

Panics if the key is not contained in the current Resolver

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

Attempts to resolve the given key into a string, returning None if it cannot be found

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

Resolves a string by its key without preforming bounds checks

Safety

The key must be valid for the current Resolver

fn contains_key(&self, key: &K) -> bool[src]

Returns true if the current interner contains the given key

fn len(&self) -> usize[src]

Gets the number of currently interned strings

Provided methods

fn is_empty(&self) -> bool[src]

Returns true if there are no currently interned strings

Implementations on Foreign Types

impl<K, I: ?Sized> Resolver<K> for Box<I> where
    K: Key,
    I: Resolver<K> + 'static, 
[src]

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

fn contains_key(&self, key: &K) -> bool[src]

fn len(&self) -> usize[src]

Implementors

impl<K> Resolver<K> for RodeoResolver<K> where
    K: Key
[src]

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

fn contains_key(&self, key: &K) -> bool[src]

fn len(&self) -> usize[src]

impl<K, S> Resolver<K> for &ThreadedRodeo<K, S> where
    K: Key + Hash,
    S: BuildHasher + Clone
[src]

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

fn contains_key(&self, key: &K) -> bool[src]

fn len(&self) -> usize[src]

impl<K, S> Resolver<K> for Rodeo<K, S> where
    K: Key
[src]

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

fn contains_key(&self, key: &K) -> bool[src]

fn len(&self) -> usize[src]

impl<K, S> Resolver<K> for RodeoReader<K, S> where
    K: Key
[src]

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

fn contains_key(&self, key: &K) -> bool[src]

fn len(&self) -> usize[src]

impl<K, S> Resolver<K> for ThreadedRodeo<K, S> where
    K: Key + Hash,
    S: BuildHasher + Clone
[src]

unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str[src]

ThreadedRodeo does not actually have a resolve_unchecked() method, so this just forwards to the normal ThreadedRodeo::resolve() method

fn resolve<'a>(&'a self, key: &K) -> &'a str[src]

fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>[src]

fn contains_key(&self, key: &K) -> bool[src]

fn len(&self) -> usize[src]