Struct Chain
#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct Chain<A, B> { pub(in ::iter::adapters::chain) a: Option<A>, pub(in ::iter::adapters::chain) b: Option<B> }
An iterator that links two iterators together, in a chain.
This struct is created by chain or Iterator::chain. See their
documentation for more.
Examples
use Chain;
use Iter;
let a1 = ;
let a2 = ;
let iter: = a1.iter.chain;
Fields
a: Option<A>b: Option<B>
Implementations
impl<A, B> Chain<A, B>
const fn new(a: A, b: B) -> Chain<A, B>
Trait Implementations
impl<A, B> DoubleEndedIterator for Chain<A, B>
where
A: DoubleEndedIterator,
B: DoubleEndedIterator<Item = A::Item>,
fn next_back(&mut self) -> Option<A::Item>fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>fn nth_back(&mut self, n: usize) -> Option<Self::Item>fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item> where P: FnMut(&Self::Item) -> bool,fn try_rfold<Acc, F, R>(&mut self, acc: Acc, f: F) -> R where Self: Sized, F: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>,fn rfold<Acc, F>(self, acc: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc,
impl<A, B> FusedIterator for Chain<A, B>
where
A: FusedIterator,
B: FusedIterator<Item = A::Item>,
impl<A, B> Iterator for Chain<A, B>
where
A: Iterator,
B: Iterator<Item = A::Item>,
type Item = <A as Iterator>::Item;fn next(&mut self) -> Option<A::Item>fn count(self) -> usizefn try_fold<Acc, F, R>(&mut self, acc: Acc, f: F) -> R where Self: Sized, F: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>,fn fold<Acc, F>(self, acc: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc,fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>fn nth(&mut self, n: usize) -> Option<Self::Item>fn find<P>(&mut self, predicate: P) -> Option<Self::Item> where P: FnMut(&Self::Item) -> bool,fn last(self) -> Option<A::Item>fn size_hint(&self) -> (usize, Option<usize>)
impl<A, B> TrustedLen for Chain<A, B>
where
A: TrustedLen,
B: TrustedLen<Item = A::Item>,
impl<A: Clone, B: Clone> Clone for Chain<A, B>
fn clone(&self) -> Chain<A, B>
impl<A: Debug, B: Debug> Debug for Chain<A, B>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<A: Default, B: Default> Default for Chain<A, B>
fn default() -> SelfCreates a
Chainfrom the default values forAandB.# use Chain; # use slice; # use ; # use mem; ; let set = new; let slice: & = &; let mut foo = Foo; // take requires `Default` let _: = take;
Auto Trait Implementations
impl<A, B> Freeze for Chain<A, B>
where
Option<A>: Freeze,
Option<B>: Freeze,
impl<A, B> RefUnwindSafe for Chain<A, B>
where
Option<A>: RefUnwindSafe,
Option<B>: RefUnwindSafe,
impl<A, B> Send for Chain<A, B>
where
Option<A>: Send,
Option<B>: Send,
impl<A, B> Sync for Chain<A, B>
where
Option<A>: Sync,
Option<B>: Sync,
impl<A, B> Unpin for Chain<A, B>
where
Option<A>: Unpin,
Option<B>: Unpin,
impl<A, B> UnsafeUnpin for Chain<A, B>
where
Option<A>: UnsafeUnpin,
Option<B>: UnsafeUnpin,
impl<A, B> UnwindSafe for Chain<A, B>
where
Option<A>: UnwindSafe,
Option<B>: UnwindSafe,
Blanket Implementations
impl<I> IntoIterator for Chain<A, B>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for Chain<A, B>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Chain<A, B>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Chain<A, B>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Chain<A, B>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Chain<A, B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Chain<A, B>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Chain<A, B>
impl<T, U> Into<U> for Chain<A, B>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Chain<A, B>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Chain<A, B>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>