pub trait Resolver<K = Spur> {
// Required methods
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;
// Provided method
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§
Sourcefn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>
fn try_resolve<'a>(&'a self, key: &K) -> Option<&'a str>
Attempts to resolve the given key into a string, returning None
if it cannot be found
Sourceunsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str
unsafe fn resolve_unchecked<'a>(&'a self, key: &K) -> &'a str
Sourcefn contains_key(&self, key: &K) -> bool
fn contains_key(&self, key: &K) -> bool
Returns true if the current interner contains the given key
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".