pub struct LendingIteratorAdapter<I>(/* private fields */);Available on crate feature
lending-iterator only.Expand description
An adapter for CursorLendingIterator which implements lending_iterator::LendingIterator.
To avoid conflicts between LendingIterator::next and CursorLendingIterator::next,
the CursorLendingIterator is not implemented for the adapter; however,
the other cursor methods (valid, current, prev) are implemented, and Seekable
is implemented if I: Seekable.
Implementations§
Source§impl<I> LendingIteratorAdapter<I>
impl<I> LendingIteratorAdapter<I>
Sourcepub fn into_inner(self) -> I
pub fn into_inner(self) -> I
Convert the adapter back into the inner iterator.
Source§impl<I: CursorLendingIterator> LendingIteratorAdapter<I>
impl<I: CursorLendingIterator> LendingIteratorAdapter<I>
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Determine whether the iterator is currently at any value in the collection.
Trait Implementations§
Source§impl<I: Clone> Clone for LendingIteratorAdapter<I>
impl<I: Clone> Clone for LendingIteratorAdapter<I>
Source§fn clone(&self) -> LendingIteratorAdapter<I>
fn clone(&self) -> LendingIteratorAdapter<I>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<I: Debug> Debug for LendingIteratorAdapter<I>
impl<I: Debug> Debug for LendingIteratorAdapter<I>
Source§impl<'next, I: CursorLendingIterator> LendingIteratorඞItem<'next> for LendingIteratorAdapter<I>
impl<'next, I: CursorLendingIterator> LendingIteratorඞItem<'next> for LendingIteratorAdapter<I>
Source§impl<I: CursorLendingIterator> LendingIterator for LendingIteratorAdapter<I>
impl<I: CursorLendingIterator> LendingIterator for LendingIteratorAdapter<I>
Source§fn filter<F>(self, should_yield: F) -> Filter<Self, F>
fn filter<F>(self, should_yield: F) -> Filter<Self, F>
LendingIterator counterpart of Iterator::filter().Source§fn for_each(self, f: impl FnMut(Self::T))where
Self: Sized,
fn for_each(self, f: impl FnMut(Self::T))where
Self: Sized,
LendingIterator counterpart of Iterator::for_each().Source§fn fold<Acc>(self, acc: Acc, f: impl FnMut(Acc, Self::T) -> Acc) -> Accwhere
Self: Sized,
fn fold<Acc>(self, acc: Acc, f: impl FnMut(Acc, Self::T) -> Acc) -> Accwhere
Self: Sized,
LendingIterator counterpart of Iterator::fold().Source§fn try_for_each<Err>(
&mut self,
f: impl FnMut(Self::T) -> Result<(), Err>,
) -> Result<(), Err>
fn try_for_each<Err>( &mut self, f: impl FnMut(Self::T) -> Result<(), Err>, ) -> Result<(), Err>
LendingIterator counterpart of Iterator::try_for_each().Source§fn try_fold<Acc, Err>(
&mut self,
acc: Acc,
f: impl FnMut(Acc, Self::T) -> Result<Acc, Err>,
) -> Result<Acc, Err>
fn try_fold<Acc, Err>( &mut self, acc: Acc, f: impl FnMut(Acc, Self::T) -> Result<Acc, Err>, ) -> Result<Acc, Err>
LendingIterator counterpart of Iterator::try_fold().Source§fn all(&mut self, predicate: impl FnMut(Self::T) -> bool) -> boolwhere
Self: Sized,
fn all(&mut self, predicate: impl FnMut(Self::T) -> bool) -> boolwhere
Self: Sized,
LendingIterator counterpart of Iterator::all().Source§fn any(&mut self, predicate: impl FnMut(Self::T) -> bool) -> boolwhere
Self: Sized,
fn any(&mut self, predicate: impl FnMut(Self::T) -> bool) -> boolwhere
Self: Sized,
LendingIterator counterpart of Iterator::any().Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
LendingIterator counterpart of Iterator::by_ref().Source§fn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
Self: Sized,
LendingIterator counterpart of Iterator::count().Source§fn find<'find>(
&'find mut self,
predicate: impl FnMut(&Self::T) -> bool + 'find,
) -> Option<Self::T>where
Self: Sized,
fn find<'find>(
&'find mut self,
predicate: impl FnMut(&Self::T) -> bool + 'find,
) -> Option<Self::T>where
Self: Sized,
LendingIterator counterpart of Iterator::find().Source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
LendingIterator counterpart of Iterator::fuse().Source§fn nth(&mut self, n: usize) -> Option<Self::T>
fn nth(&mut self, n: usize) -> Option<Self::T>
LendingIterator counterpart of Iterator::nth().Source§fn position<F>(
&mut self,
predicate: impl FnMut(Self::T) -> bool,
) -> Option<usize>where
Self: Sized,
fn position<F>(
&mut self,
predicate: impl FnMut(Self::T) -> bool,
) -> Option<usize>where
Self: Sized,
LendingIterator counterpart of Iterator::position().Source§fn skip(self, count: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, count: usize) -> Skip<Self>where
Self: Sized,
LendingIterator counterpart of Iterator::skip().Source§fn take(self, count: usize) -> Take<Self>where
Self: Sized,
fn take(self, count: usize) -> Take<Self>where
Self: Sized,
LendingIterator counterpart of Iterator::take().Source§fn map_to_ref<R, F>(
self,
f: F,
) -> Map<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ R>>>
fn map_to_ref<R, F>( self, f: F, ) -> Map<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ R>>>
Source§fn map_to_mut<R, F>(
self,
f: F,
) -> Map<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ mut R>>>
fn map_to_mut<R, F>( self, f: F, ) -> Map<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ mut R>>>
Source§fn map_into_iter<F, NonLendingItem>(self, f: F) -> MapIntoIter<Self, F>
fn map_into_iter<F, NonLendingItem>(self, f: F) -> MapIntoIter<Self, F>
Convenience shorthand for
.map…(…).into_iter(). Read moreSource§fn filter_map<NewItemType, F>(self, f: F) -> FilterMap<Self, F, NewItemType>
fn filter_map<NewItemType, F>(self, f: F) -> FilterMap<Self, F, NewItemType>
Source§fn filter_map_to_ref<R, F>(
self,
f: F,
) -> FilterMap<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ R>>>
fn filter_map_to_ref<R, F>( self, f: F, ) -> FilterMap<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ R>>>
Convenience method: same as
.filter_map(), but for hard-coding the
HKT parameter to HKTRef<R> = HKT!(&R). Read moreSource§fn filter_map_to_mut<R, F>(
self,
f: F,
) -> FilterMap<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ mut R>>>
fn filter_map_to_mut<R, F>( self, f: F, ) -> FilterMap<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ mut R>>>
Convenience method: same as
.filter_map(), but for hard-coding the
HKT parameter to HKTRefMut<R> = HKT!(&mut R). Read moreSource§fn filter_map_into_iter<F, NonLendingItem>(
self,
f: F,
) -> FilterMapIntoIter<Self, F>
fn filter_map_into_iter<F, NonLendingItem>( self, f: F, ) -> FilterMapIntoIter<Self, F>
Convenience shorthand for
.filter_map…(…).into_iter(). Read moreSource§impl<I: PartialEq> PartialEq for LendingIteratorAdapter<I>
impl<I: PartialEq> PartialEq for LendingIteratorAdapter<I>
Source§impl<Key, Cmp, I> Seekable<Key, Cmp> for LendingIteratorAdapter<I>
impl<Key, Cmp, I> Seekable<Key, Cmp> for LendingIteratorAdapter<I>
Source§fn reset(&mut self)
fn reset(&mut self)
Reset the iterator to its initial position, before the first entry and after the last
entry (if there are any entries in the collection). Read more
Source§fn seek(&mut self, min_bound: &Key)
fn seek(&mut self, min_bound: &Key)
Move the iterator to the smallest key which is greater or equal than the provided
min_bound. Read moreSource§fn seek_before(&mut self, strict_upper_bound: &Key)
fn seek_before(&mut self, strict_upper_bound: &Key)
Move the iterator to the greatest key which is strictly less than the provided
strict_upper_bound. Read moreSource§fn seek_to_first(&mut self)
fn seek_to_first(&mut self)
Move the iterator to the smallest key in the collection. Read more
Source§fn seek_to_last(&mut self)
fn seek_to_last(&mut self)
Move the iterator to the greatest key in the collection. Read more
impl<I: Eq> Eq for LendingIteratorAdapter<I>
impl<I> StructuralPartialEq for LendingIteratorAdapter<I>
Auto Trait Implementations§
impl<I> Freeze for LendingIteratorAdapter<I>where
I: Freeze,
impl<I> RefUnwindSafe for LendingIteratorAdapter<I>where
I: RefUnwindSafe,
impl<I> Send for LendingIteratorAdapter<I>where
I: Send,
impl<I> Sync for LendingIteratorAdapter<I>where
I: Sync,
impl<I> Unpin for LendingIteratorAdapter<I>where
I: Unpin,
impl<I> UnwindSafe for LendingIteratorAdapter<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FragileContainer<T> for Twhere
T: ?Sized,
impl<T> FragileContainer<T> for Twhere
T: ?Sized,
Source§fn get_ref(&self) -> <T as FragileTryContainer<T>>::Ref<'_>
fn get_ref(&self) -> <T as FragileTryContainer<T>>::Ref<'_>
Infallibly get immutable access to the T.
Source§impl<T> FragileMutContainer<T> for Twhere
T: ?Sized,
impl<T> FragileMutContainer<T> for Twhere
T: ?Sized,
Source§fn get_mut(&mut self) -> <T as FragileTryMutContainer<T>>::RefMut<'_>
fn get_mut(&mut self) -> <T as FragileTryMutContainer<T>>::RefMut<'_>
Infallibly get mutable access to the T.
Source§impl<T> FragileTryContainer<T> for Twhere
T: ?Sized,
impl<T> FragileTryContainer<T> for Twhere
T: ?Sized,
Source§fn into_inner(self) -> Option<T>
fn into_inner(self) -> Option<T>
Infallibly get the T.
Source§fn try_get_ref(
&self,
) -> Result<<T as FragileTryContainer<T>>::Ref<'_>, <T as FragileTryContainer<T>>::RefError>
fn try_get_ref( &self, ) -> Result<<T as FragileTryContainer<T>>::Ref<'_>, <T as FragileTryContainer<T>>::RefError>
Infallibly get immutable access to the T.
Source§type RefError = Infallible
type RefError = Infallible
An error that might be returned by
try_get_ref. This type should implement
std::error::Error. Read moreSource§fn new_container(t: T) -> T
fn new_container(t: T) -> T
Create a new container that owns the provided
T.Source§impl<T> FragileTryMutContainer<T> for Twhere
T: ?Sized,
impl<T> FragileTryMutContainer<T> for Twhere
T: ?Sized,
Source§fn try_get_mut(
&mut self,
) -> Result<<T as FragileTryMutContainer<T>>::RefMut<'_>, <T as FragileTryMutContainer<T>>::RefMutError>
fn try_get_mut( &mut self, ) -> Result<<T as FragileTryMutContainer<T>>::RefMut<'_>, <T as FragileTryMutContainer<T>>::RefMutError>
Infallibly get mutable access to the T.
Source§type RefMut<'a> = &'a mut T
where
T: 'a
type RefMut<'a> = &'a mut T where T: 'a
A mutably borrowed value from the container. Read more
Source§type RefMutError = Infallible
type RefMutError = Infallible
An error that might be returned by
try_get_mut. This type should implement
std::error::Error. Read more