Skip to main content

LendItem

Trait LendItem 

Source
pub trait LendItem<'lend, __ImplyBound: ImplyBound = &'lend Self> {
    type Item: 'lend;
}
Expand description

Trait for getting the item of a lending iterator.

The lifetime can force the consumer to drop the item before obtaining a new item (which requires a mutable borrow to the iterator, invalidating the borrow of the previous item).

See lender for why this strategy is used instead of a simple GAT.

Required Associated Types§

Source

type Item: 'lend

The item of a lending iterator, with a particular lifetime.

The lifetime can force the consumer to drop the item before obtaining a new item (which requires a mutable borrow to the iterator, invalidating the borrow of the previous item).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'lend, Key, Cmp, Iter> LendItem<'lend> for MergingIter<Key, Cmp, Iter>
where Key: ?Sized, Iter: LendItem<'lend>,

Available on crate feature alloc only.
Source§

type Item = <Iter as LendItem<'lend>>::Item