Trait lasso::Resolver

source ·
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§

Resolves the given key into a string

Panics

Panics if the key is not contained in the current Resolver

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

Resolves a string by its key without preforming bounds checks

Safety

The key must be valid for the current Resolver

Returns true if the current interner contains the given key

Gets the number of currently interned strings

Provided Methods§

Returns true if there are no currently interned strings

Implementations on Foreign Types§

Implementors§