Skip to main content

Reader

Trait Reader 

Source
pub trait Reader<K = Spur>: Resolver<K> {
    // Required methods
    fn get(&self, val: &str) -> Option<K>;
    fn contains(&self, val: &str) -> bool;
}
Expand description

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

Required Methods§

Source

fn get(&self, val: &str) -> Option<K>

Get a key for the given string value if it exists

Source

fn contains(&self, val: &str) -> bool

Returns true if the current interner contains the given string

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K, I> Reader<K> for Box<I>
where K: Key, I: Reader<K> + ?Sized + 'static,

Source§

fn get(&self, val: &str) -> Option<K>

Source§

fn contains(&self, val: &str) -> bool

Source§

impl<T, K> Reader<K> for &T
where T: Reader<K>,

Source§

fn get(&self, val: &str) -> Option<K>

Source§

fn contains(&self, val: &str) -> bool

Source§

impl<T, K> Reader<K> for &mut T
where T: Reader<K>,

Source§

fn get(&self, val: &str) -> Option<K>

Source§

fn contains(&self, val: &str) -> bool

Implementors§

Source§

impl<K, S> Reader<K> for Rodeo<K, S>
where K: Key, S: BuildHasher,

Source§

impl<K, S> Reader<K> for RodeoReader<K, S>
where K: Key, S: BuildHasher,

Source§

impl<K, S> Reader<K> for ThreadedRodeo<K, S>
where K: Key + Hash, S: BuildHasher + Clone,

Available on crate feature multi-threaded only.