PooledLendingIteratorAdapter

Struct PooledLendingIteratorAdapter 

Source
pub struct PooledLendingIteratorAdapter<I: PooledIterator> { /* private fields */ }
Available on crate feature lending-iterator only.
Expand description

An adapter for PooledIterator which implements lending_iterator::LendingIterator.

To avoid conflicts between LendingIterator::next and PooledIterator::next, the PooledIterator is not implemented for the adapter; however, the other cursor methods (valid, current, prev) are implemented if I: CursorPooledIterator, and Seekable is implemented if I: Seekable.

Implementations§

Source§

impl<I: PooledIterator> PooledLendingIteratorAdapter<I>

Source

pub fn into_inner(self) -> I

Convert the adapter back into the inner iterator.

Source§

impl<I: CursorPooledIterator> PooledLendingIteratorAdapter<I>

Source

pub fn valid(&self) -> bool

Determine whether the iterator is currently at any value in the collection.

See CursorPooledIterator::valid().

Source

pub const fn current(&self) -> Option<Item<'_, Self>>

Get the current value the iterator is at.

This is cheap, and does not require getting a new buffer.

See CursorPooledIterator::current().

Source

pub fn prev(&mut self) -> Option<Item<'_, Self>>

Move the iterator one position back, and return the entry at that position. Returns None if the iterator was at the first entry.

See CursorPooledIterator::prev().

Trait Implementations§

Source§

impl<I: Clone + PooledIterator> Clone for PooledLendingIteratorAdapter<I>
where I::Item: Clone,

Source§

fn clone(&self) -> PooledLendingIteratorAdapter<I>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: Debug + PooledIterator> Debug for PooledLendingIteratorAdapter<I>
where I::Item: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'next, I: PooledIterator> LendingIteratorඞItem<'next> for PooledLendingIteratorAdapter<I>

Source§

type T = &'next <I as PooledIterator>::Item

Source§

impl<I: PooledIterator> LendingIterator for PooledLendingIteratorAdapter<I>

Source§

fn next(&mut self) -> Option<Item<'_, Self>>

Query the next() Item of this Self iterator. Read more
Source§

fn filter<F>(self, should_yield: F) -> Filter<Self, F>
where Self: Sized, F: FnMut(&Self::T) -> bool,

Source§

fn for_each(self, f: impl FnMut(Self::T))
where Self: Sized,

Source§

fn fold<Acc>(self, acc: Acc, f: impl FnMut(Acc, Self::T) -> Acc) -> Acc
where Self: Sized,

Source§

fn try_for_each<Err>( &mut self, f: impl FnMut(Self::T) -> Result<(), Err>, ) -> Result<(), Err>

Source§

fn try_fold<Acc, Err>( &mut self, acc: Acc, f: impl FnMut(Acc, Self::T) -> Result<Acc, Err>, ) -> Result<Acc, Err>

Source§

fn all(&mut self, predicate: impl FnMut(Self::T) -> bool) -> bool
where Self: Sized,

Source§

fn any(&mut self, predicate: impl FnMut(Self::T) -> bool) -> bool
where Self: Sized,

Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Source§

fn count(self) -> usize
where Self: Sized,

Source§

fn find<'find>( &'find mut self, predicate: impl FnMut(&Self::T) -> bool + 'find, ) -> Option<Self::T>
where Self: Sized,

Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Source§

fn nth(&mut self, n: usize) -> Option<Self::T>

Source§

fn position<F>( &mut self, predicate: impl FnMut(Self::T) -> bool, ) -> Option<usize>
where Self: Sized,

Source§

fn skip(self, count: usize) -> Skip<Self>
where Self: Sized,

Source§

fn take(self, count: usize) -> Take<Self>
where Self: Sized,

Source§

fn map<NewItemType, F>(self, f: F) -> Map<Self, F, NewItemType>
where NewItemType: HKT, F: for<'next> FnMut([&'next Self; 0], Self::T) -> <NewItemType as WithLifetime<'next>>::T, Self: Sized,

Source§

fn map_to_ref<R, F>( self, f: F, ) -> Map<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ R>>>
where F: for<'any> FnMut([&'any Self; 0], Self::T) -> &'any R, Self: Sized, R: ?Sized,

Convenience method: same as .map(), but for hard-coding the HKT parameter to HKTRef<R> = HKT!(&R). Read more
Source§

fn map_to_mut<R, F>( self, f: F, ) -> Map<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ mut R>>>
where F: for<'any> FnMut([&'any Self; 0], Self::T) -> &'any mut R, Self: Sized, R: ?Sized,

Convenience method: same as .map(), but for hard-coding the HKT parameter to HKTRefMut<R> = HKT!(&mut R). Read more
Source§

fn map_into_iter<F, NonLendingItem>(self, f: F) -> MapIntoIter<Self, F>
where F: FnMut(Self::T) -> NonLendingItem, Self: Sized,

Convenience shorthand for .map…(…).into_iter(). Read more
Source§

fn filter_map<NewItemType, F>(self, f: F) -> FilterMap<Self, F, NewItemType>
where NewItemType: HKT, F: for<'next> FnMut([&'next Self; 0], Self::T) -> Option<<NewItemType as WithLifetime<'next>>::T>, Self: Sized,

Source§

fn filter_map_to_ref<R, F>( self, f: F, ) -> FilterMap<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ R>>>
where F: for<'any> FnMut([&'any Self; 0], Self::T) -> Option<&'any R>, Self: Sized, R: ?Sized,

Convenience method: same as .filter_map(), but for hard-coding the HKT parameter to HKTRef<R> = HKT!(&R). Read more
Source§

fn filter_map_to_mut<R, F>( self, f: F, ) -> FilterMap<Self, F, HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = &'ඞ mut R>>>
where F: for<'any> FnMut([&'any Self; 0], Self::T) -> Option<&'any mut R>, Self: Sized, R: ?Sized,

Convenience method: same as .filter_map(), but for hard-coding the HKT parameter to HKTRefMut<R> = HKT!(&mut R). Read more
Source§

fn filter_map_into_iter<F, NonLendingItem>( self, f: F, ) -> FilterMapIntoIter<Self, F>
where F: FnMut(Self::T) -> Option<NonLendingItem>, Self: Sized,

Convenience shorthand for .filter_map…(…).into_iter(). Read more
Source§

fn into_iter<Item>(self) -> IntoIter<Self>
where Self: for<'any> LendingIteratorඞItem<'any, T = Item> + Sized,

Convert a Self : LendingIterator into an Iterator, provided Self::Item<'_> does not depend on '_.
Source§

impl<I: PartialEq + PooledIterator> PartialEq for PooledLendingIteratorAdapter<I>
where I::Item: PartialEq,

Source§

fn eq(&self, other: &PooledLendingIteratorAdapter<I>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Key, Cmp, I> Seekable<Key, Cmp> for PooledLendingIteratorAdapter<I>
where Key: ?Sized, Cmp: ?Sized + Comparator<Key>, I: Seekable<Key, Cmp> + PooledIterator,

Source§

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)

Move the iterator to the smallest key which is greater or equal than the provided min_bound. Read more
Source§

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 more
Source§

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)

Move the iterator to the greatest key in the collection. Read more
Source§

impl<I: Eq + PooledIterator> Eq for PooledLendingIteratorAdapter<I>
where I::Item: Eq,

Source§

impl<I: PooledIterator> StructuralPartialEq for PooledLendingIteratorAdapter<I>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> FragileContainer<T> for T
where T: ?Sized,

Source§

fn get_ref(&self) -> <T as FragileTryContainer<T>>::Ref<'_>

Infallibly get immutable access to the T.

Source§

impl<T> FragileMutContainer<T> for T
where T: ?Sized,

Source§

fn get_mut(&mut self) -> <T as FragileTryMutContainer<T>>::RefMut<'_>

Infallibly get mutable access to the T.

Source§

impl<T> FragileTryContainer<T> for T
where T: ?Sized,

Source§

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>

Infallibly get immutable access to the T.

Source§

type Ref<'a> = &'a T where T: 'a

An immutably borrowed value from the container. Read more
Source§

type RefError = Infallible

An error that might be returned by try_get_ref. This type should implement std::error::Error. Read more
Source§

fn new_container(t: T) -> T

Create a new container that owns the provided T.
Source§

impl<T> FragileTryMutContainer<T> for T
where T: ?Sized,

Source§

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

A mutably borrowed value from the container. Read more
Source§

type RefMutError = Infallible

An error that might be returned by try_get_mut. This type should implement std::error::Error. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LendingIteratorDyn for T
where T: LendingIterator,

Source§

type Item = HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = <T as LendingIteratorඞItem<'ඞ>>::T>>

Another approach to a GAT in stable Rust: use a classic associated type, but with a HKT bound on it, so that it can still be fed a lifetime parameter.
Source§

fn dyn_next<'n>( &'n mut self, ) -> Option<<HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = <T as LendingIteratorඞItem<'ඞ>>::T>> as WithLifetime<'n>>::T>

A dyn-safe version of LendingIterator::next(), using [Self::Item]. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, C> BaseContainer<T> for C
where C: FragileTryContainer<T> + ?Sized, T: ?Sized,

Source§

impl<T, C> BaseMutContainer<T> for C
where C: FragileTryMutContainer<T> + ?Sized, T: ?Sized,

Source§

impl<T> Container<T> for T
where T: ?Sized,

Source§

impl<T> MutContainer<T> for T
where T: ?Sized,

Source§

impl<T> TryContainer<T> for T
where T: ?Sized,

Source§

impl<T> TryMutContainer<T> for T
where T: ?Sized,