Trait Index

Source
pub trait Index {
    type Key: ?Sized + Hash + PartialEq + Eq;

    // Required method
    fn index(&self) -> &Self::Key;
}
Available on crate feature index-map only.
Expand description

The main index type to implement for each type to be stored in an IndexMap.

Required Associated Types§

Source

type Key: ?Sized + Hash + PartialEq + Eq

The type of the key.

Required Methods§

Source

fn index(&self) -> &Self::Key

The index function which returns a reference to the key stored in the object.

Implementations on Foreign Types§

Source§

impl<T: Index> Index for Rc<T>

Source§

type Key = <T as Index>::Key

Source§

fn index(&self) -> &Self::Key

Source§

impl<T: Index> Index for Arc<T>

Source§

type Key = <T as Index>::Key

Source§

fn index(&self) -> &Self::Key

Implementors§