pub trait HashTableKeyable<K: ?Sized> {
type Key<'a>: Borrow<K>
where Self: 'a;
// Required method
fn get_key(&self) -> Self::Key<'_>;
}Expand description
Trait that types must implement to expose the key used to store them in a HashTable.
This is the Rust analog of the GetKey portion of C++’s fbl::DefaultKeyedObjectTraits.
Keys are compared for equality using K: Eq (the analog of KeyTraits::EqualTo).
The key of an object must not change while the object is contained in a HashTable.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".