Struct chd::iter::Hunks

source ·
pub struct Hunks<'a, F: Read + Seek> { /* private fields */ }
Available on unstable_lending_iterators only.
Expand description

An iterator over the hunks of a CHD file.

Trait Implementations§

source§

impl<'next, 'a, F: Read + Seek> LendingIteratorඞItem<'next> for Hunks<'a, F>

§

type T = Hunk<'next, F>

source§

impl<'a, F: Read + Seek> LendingIterator for Hunks<'a, F>

source§

fn next(&mut self) -> Option<Hunk<'_, F>>

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§

fn dyn_boxed<'usability>( self ) -> Box<dyn LendingIteratorDyn<Item = HKT<dyn for<'ඞ> WithLifetime<'ඞ, T = Self::T>>> + 'usability>
where Self: 'usability + Sized,

Converts this LendingIterator into a Box<dyn LendingIteratorDyn…>. Read more
source§

fn dyn_boxed_auto<BoxedDynLendingIterator, Item>( self ) -> BoxedDynLendingIterator
where Item: HKT, Self: Sized + DynCoerce<BoxedDynLendingIterator, Item>,

Converts this LendingIterator into a Box<dyn LendingIteratorDyn…>. Read more

Auto Trait Implementations§

§

impl<'a, F> RefUnwindSafe for Hunks<'a, F>
where F: RefUnwindSafe,

§

impl<'a, F> Send for Hunks<'a, F>
where F: Send,

§

impl<'a, F> Sync for Hunks<'a, F>
where F: Sync,

§

impl<'a, F> Unpin for Hunks<'a, F>

§

impl<'a, F> !UnwindSafe for Hunks<'a, F>

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> 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,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.