Trait cc_traits::Get

source ·
pub trait Get<T>: CollectionRef {
    // Required method
    fn get(&self, key: T) -> Option<Self::ItemRef<'_>>;

    // Provided method
    fn contains(&self, key: T) -> bool { ... }
}
Expand description

Queryable collection.

Required Methods§

source

fn get(&self, key: T) -> Option<Self::ItemRef<'_>>

Returns a reference to the item stored behind the given key (if any).

Provided Methods§

source

fn contains(&self, key: T) -> bool

Checks if the collection contains an item behind the given key.

Implementations on Foreign Types§

source§

impl<'a, Q, T> Get<&'a Q> for BTreeSet<T>where T: Borrow<Q> + Ord, Q: Ord + ?Sized,

source§

fn get(&self, t: &'a Q) -> Option<&T>

source§

impl<'a, Q, K, V> Get<&'a Q> for HashMap<K, V>where K: Borrow<Q> + Hash + Eq, Q: Hash + Eq + ?Sized,

source§

fn get(&self, key: &'a Q) -> Option<&V>

source§

impl<T> Get<usize> for Vec<T>

source§

fn get(&self, index: usize) -> Option<&T>

source§

impl<'a, Q, T> Get<&'a Q> for HashSet<T>where T: Borrow<Q> + Hash + Eq, Q: Hash + Eq + ?Sized,

source§

fn get(&self, value: &'a Q) -> Option<&T>

source§

impl<'a, Q, K, V> Get<&'a Q> for BTreeMap<K, V>where K: Borrow<Q> + Ord, Q: Ord + ?Sized,

source§

fn get(&self, key: &'a Q) -> Option<&V>

Implementors§