ItemToKey

Trait ItemToKey 

Source
pub trait ItemToKey<Key: ?Sized>: for<'lend> LendItem<'lend> {
    // Required method
    fn item_to_key(item: LentItem<'_, Self>) -> &Key;
}
Expand description

Convert one of the items of an iterator into a Key reference, intended for use with a SeekableLendingIterator.

This conversion is expected to be cheap.

Required Methods§

Source

fn item_to_key(item: LentItem<'_, Self>) -> &Key

Convert one of the items of an iterator into a Key reference, intended for use with a SeekableLendingIterator.

This conversion is expected to be cheap.

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.

Implementors§

Source§

impl<Key, Cmp, Iter> ItemToKey<Key> for MergingIter<Key, Cmp, Iter>
where Key: ?Sized, Iter: ItemToKey<Key>,

Available on crate feature alloc only.