[go: up one dir, main page]

Trait ExtractKey

Source
pub trait ExtractKey<K: Hash + Eq> {
    // Required method
    fn extract_key(&self) -> &K;
}
Expand description

A trait for extracting the key for an ExtractMap.

This is relied on for correctness in the same way as Hash and Eq are and is purely designed for directly referencing a field with no interior mutability or static return type, the documentation on HashSet should be followed for this key type.

Required Methods§

Source

fn extract_key(&self) -> &K

Extracts the key that this value should be referred to with.

Implementors§