Skip to main content

GetIDValue

Trait GetIDValue 

Source
pub trait GetIDValue<K: ID, V> {
    // Required method
    fn get_id_value<S: Borrow<str> + ?Sized>(
        &self,
        id: &S,
    ) -> Result<(&K, &V), MissingIDError<K>>;
}
Expand description

A trait for getting an ID and a value from a map

Required Methods§

Source

fn get_id_value<S: Borrow<str> + ?Sized>( &self, id: &S, ) -> Result<(&K, &V), MissingIDError<K>>

Get the ID and value, if any, for the given collection

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<K: ID + Borrow<str>, V> GetIDValue<K, V> for IndexMap<K, V>

Source§

fn get_id_value<S: Borrow<str> + ?Sized>( &self, id: &S, ) -> Result<(&K, &V), MissingIDError<K>>

Implementors§