pub trait Resolver<Key: InternKey = TokenKey> {
// Required method
fn try_resolve(&self, key: Key) -> Option<&str>;
// Provided method
fn resolve(&self, key: Key) -> &str { ... }
}Expand description
The read-only part of an interner. Allows to perform lookups of intern keys to resolve them to their interned text.
Required Methods§
Sourcefn try_resolve(&self, key: Key) -> Option<&str>
fn try_resolve(&self, key: Key) -> Option<&str>
Tries to resolve the given key and return its interned text.
If self does not contain any text for key, None is returned.
Provided Methods§
Sourcefn resolve(&self, key: Key) -> &str
fn resolve(&self, key: Key) -> &str
Resolves key to its interned text.
§Panics
Panics if there is no text for key.
Compatibility implementations for interners from other crates may also panic if key cannot be converted to the
key type of the external interner. Please ensure you configure any external interners appropriately (for
example by choosing an appropriately sized key type).
Implementations on Foreign Types§
Source§impl Resolver for Arc<MultiThreadedTokenInterner>
Available on crate feature multi_threaded_interning only.
impl Resolver for Arc<MultiThreadedTokenInterner>
Available on crate feature
multi_threaded_interning only.Source§impl<K> Resolver for RodeoResolver<K>where
K: Key,
Available on crate feature lasso_compat only.
impl<K> Resolver for RodeoResolver<K>where
K: Key,
Available on crate feature
lasso_compat only.Source§impl<K, S> Resolver for RodeoReader<K, S>where
K: Key,
Available on crate feature lasso_compat only.
impl<K, S> Resolver for RodeoReader<K, S>where
K: Key,
Available on crate feature
lasso_compat only.Source§impl<K, S> Resolver for Rodeo<K, S>where
K: Key,
Available on crate feature lasso_compat only.
impl<K, S> Resolver for Rodeo<K, S>where
K: Key,
Available on crate feature
lasso_compat only.Source§impl<K, S> Resolver for ThreadedRodeo<K, S>
Available on crate feature multi_threaded_interning only.
impl<K, S> Resolver for ThreadedRodeo<K, S>
Available on crate feature
multi_threaded_interning only.Implementors§
impl Resolver for MultiThreadedTokenInterner
Available on crate feature
multi_threaded_interning only.impl Resolver for TokenInterner
Available on crate feature
lasso_compat only.