Struct EmptyCol

Source
pub struct EmptyCol<T> { /* private fields */ }
Expand description

An iterable collection without any element.

Trait Implementations§

Source§

impl<T> Collection for EmptyCol<T>

Source§

type Item = T

Type of elements stored by the collection.
Source§

type Iterable<'i> = &'i EmptyCol<T> where Self: 'i

Related type implementing Iterable trait that the as_iterable method returns. If the type of the Collection is X, the corresponding Iterable type is almost always &X due to the following relation among the both traits. Read more
Source§

fn as_iterable(&self) -> Self::Iterable<'_>

Returns the corresponding Iterable type of this collection, which is often nothing but &Self.
Source§

fn iter(&self) -> <Self::Iterable<'_> as Iterable>::Iter

Creates a new iterator yielding references to the elements of the collection; i.e., type of elements is &Collection::Item.
Source§

fn into_chained<I>(self, other: I) -> ChainedCol<Self, I, Self, I>
where Self: Sized, I: Collection<Item = Self::Item>,

Consumes this collection and other; creates an iterable collection which is a chain of these two collections. Read more
Source§

fn into_filtered<P>(self, filter: P) -> FilteredCol<Self, Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Consumes this collection and creates an iterable collection which is a filtered version of this collection. Read more
Source§

fn into_flattened(self) -> FlattenedCol<Self, Self>
where Self: Sized, Self::Item: IntoIterator, for<'i> &'i Self::Item: IntoIterator<Item = &'i <Self::Item as IntoIterator>::Item>,

Consumes this collection and creates an iterable collection which is a flattened version of this collection. Read more
Source§

fn into_fused(self) -> FusedCol<Self, Self>
where Self: Sized,

Consumes this collection and creates an iterable collection which is a fused version of this collection. Read more
Source§

fn into_reversed(self) -> ReversedCol<Self, Self>
where Self: Sized, for<'b> <Self::Iterable<'b> as Iterable>::Iter: DoubleEndedIterator,

Consumes this collection and creates an iterable collection which is a reversed version of this collection. Read more
Source§

fn into_skipped(self, n: usize) -> SkippedCol<Self, Self>
where Self: Sized,

Consumes this collection and creates an iterable collection which is skipped-by-n version of this collection. Read more
Source§

fn into_skipped_while<P>(self, skip_while: P) -> SkippedWhileCol<Self, Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Consumes this collection and creates an iterable collection which is skipped-while version of this collection. Read more
Source§

fn into_stepped_by(self, step: usize) -> SteppedByCol<Self, Self>
where Self: Sized,

Consumes this collection and creates an iterable collection which is stepped-by-step version of this collection. Read more
Source§

fn into_taken(self, n: usize) -> TakenCol<Self, Self>
where Self: Sized,

Consumes this collection and creates an iterable collection which is taken-n version of this collection. Read more
Source§

fn into_taken_while<P>(self, take_while: P) -> TakenWhileCol<Self, Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Consumes this collection and creates an iterable collection which is taken-while version of this collection. Read more
Source§

impl<T> CollectionMut for EmptyCol<T>

Source§

type IterMut<'i> = Empty<&'i mut T> where Self: 'i

Type of the iterator yielding mutable references created by the iter_mut method.
Source§

fn iter_mut(&mut self) -> Self::IterMut<'_>

Creates a new iterator yielding mutable references to the elements of the collection; i.e., type of elements is &mut Collection::Item.
Source§

fn chained_mut<'a, I>( &'a mut self, other: &'a mut I, ) -> ChainedCol<Self, I, &'a mut Self, &'a mut I>
where Self: Sized, I: CollectionMut<Item = Self::Item>,

Combines mutable references of this collection and other; and creates an iterable collection which is a chain of these two collections. Read more
Source§

fn filtered_mut<P>(&mut self, filter: P) -> FilteredCol<Self, &mut Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Creates an iterable collection view which is a filtered version of this collection from its mutable reference. Read more
Source§

fn flattened_mut(&mut self) -> FlattenedCol<Self, &mut Self>
where Self: Sized, Self::Item: IntoIterator, for<'i> &'i Self::Item: IntoIterator<Item = &'i <Self::Item as IntoIterator>::Item>, for<'i> &'i mut Self::Item: IntoIterator<Item = &'i mut <Self::Item as IntoIterator>::Item>,

Creates an iterable collection view which is a flattened version of this collection from its mutable reference. Read more
Source§

fn fused_mut(&mut self) -> FusedCol<Self, &mut Self>
where Self: Sized,

Creates an iterable collection view which is a fused version of this collection from its mutable reference. Read more
Source§

fn reversed_mut(&mut self) -> ReversedCol<Self, &mut Self>
where Self: Sized, for<'b> <Self::Iterable<'b> as Iterable>::Iter: DoubleEndedIterator, for<'b> Self::IterMut<'b>: DoubleEndedIterator,

Creates an iterable collection view which is a reversed version of this collection from its mutable reference. Read more
Source§

fn skipped_mut(&mut self, n: usize) -> SkippedCol<Self, &mut Self>
where Self: Sized,

Creates an iterable collection view which is skipped-by-n version of this collection from its mutable reference. Read more
Source§

fn skipped_while_mut<P>( &mut self, skip_while: P, ) -> SkippedWhileCol<Self, &mut Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Creates an iterable collection view which is skipped-while version of this collection from its mutable reference. Read more
Source§

fn stepped_by_mut(&mut self, step: usize) -> SteppedByCol<Self, &mut Self>
where Self: Sized,

Creates an iterable collection view which is stepped-by-step version of this collection from its mutable reference. Read more
Source§

fn taken_mut(&mut self, n: usize) -> TakenCol<Self, &mut Self>
where Self: Sized,

Creates an iterable collection view which is taken-n version of this collection from its mutable reference. Read more
Source§

fn taken_while_mut<P>( &mut self, take_while: P, ) -> TakenWhileCol<Self, &mut Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Creates an iterable collection view which is taken-while version of this collection from its mutable reference. Read more
Source§

impl<T> CollectionMutObj for EmptyCol<T>

Source§

fn boxed_iter_mut(&mut self) -> Box<dyn Iterator<Item = &mut Self::Item> + '_>

Creates a new iterator in a box yielding mutable references to the elements of the collection; i.e., type of elements is &mut Item.
Source§

impl<T> CollectionObj for EmptyCol<T>

Source§

type Item = T

Type of elements stored by the collection.
Source§

fn boxed_iter(&self) -> Box<dyn Iterator<Item = &Self::Item> + '_>

Creates a new iterator in a box yielding references to the elements of the collection; i.e., type of elements is &Item.
Source§

impl<'a, T> Iterable for &'a EmptyCol<T>

Source§

type Item = &'a T

Type of the item that the iterators created by the iter method yields.
Source§

type Iter = Empty<<&'a EmptyCol<T> as Iterable>::Item>

Type of the iterator created by the iter method.
Source§

fn iter(&self) -> Self::Iter

Creates a new iterator from this iterable yielding elements of type Iterable::Item.
Source§

fn chained<I>(self, other: I) -> Chained<Self, I>
where Self: Sized, I: Iterable<Item = Self::Item>,

Takes two iterables and creates a new iterable over both in sequence. Read more
Source§

fn cloned<'a, T>(self) -> Cloned<'a, T, Self>
where Self: Sized + Iterable<Item = &'a T>, T: Clone,

Creates an iterable, iterators of which clone all of its elements. Read more
Source§

fn copied<'a, T>(self) -> Copied<'a, T, Self>
where Self: Sized + Iterable<Item = &'a T>, T: Copy,

Creates an iterable, iterators of which copy all of its elements. Read more
Source§

fn enumerated(self) -> Enumerated<Self>
where Self: Sized,

Creates an iterable which gives the current iteration count as well as the next value. Read more
Source§

fn filter_mapped<M, U>(self, filter_map: M) -> FilterMapped<Self, M, U>
where Self: Sized, M: Fn(Self::Item) -> Option<U> + Copy,

Creates an iterable that both filters and maps. Read more
Source§

fn filtered<P>(self, filter: P) -> Filtered<Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Creates an iterable which uses a closure to determine if an element should be yielded. Read more
Source§

fn flat_mapped<M, U>(self, flat_map: M) -> FlatMapped<Self, M, U>
where Self: Sized, U: IntoIterator, M: Fn(Self::Item) -> U + Copy,

Creates an iterable that works like map, but flattens nested structure. Read more
Source§

fn flattened(self) -> Flattened<Self>
where Self: Sized, Self::Item: IntoIterator,

Creates an iterable that flattens nested structure. Read more
Source§

fn fused(self) -> Fused<Self>
where Self: Sized,

Creates an iterable which ends after the first None. Read more
Source§

fn mapped_while<M, U>(self, map_while: M) -> MappedWhile<Self, M, U>
where Self: Sized, M: Fn(Self::Item) -> Option<U> + Copy,

Creates an iterable that both yields elements based on a predicate and maps. Read more
Source§

fn mapped<M, U>(self, map: M) -> Mapped<Self, M, U>
where Self: Sized, M: Fn(Self::Item) -> U + Copy,

Takes a closure and creates an iterable which calls that closure on each element. Read more
Source§

fn reversed(self) -> Reversed<Self>
where Self: Sized, Self::Iter: DoubleEndedIterator,

Creates an iterable iterators of which reverses the traversal direction. Read more
Source§

fn skipped(self, n: usize) -> Skipped<Self>
where Self: Sized,

Creates an iterable, iterators of which skip the first n elements. Read more
Source§

fn skipped_while<P>(self, skip_while: P) -> SkippedWhile<Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Creates an iterable, iterators of which skip elements based on a predicate. Read more
Source§

fn stepped_by(self, step: usize) -> SteppedBy<Self>
where Self: Sized,

Creates an iterable starting at the same point, but stepping by the given amount at each iteration. Read more
Source§

fn taken(self, n: usize) -> Taken<Self>
where Self: Sized,

Creates an iterable whose iterators yield the first n elements, or fewer if the underlying iterator ends sooner. Read more
Source§

fn taken_while<P>(self, take_while: P) -> TakenWhile<Self, P>
where Self: Sized, P: Fn(&Self::Item) -> bool + Copy,

Creates an iterable, iterators of which yield elements based on a predicate. Read more
Source§

fn zipped<I>(self, other: I) -> Zipped<Self, I>
where Self: Sized, I: Iterable,

‘Zips up’ two iterables into a single iterable of pairs. Read more
Source§

impl<'a, T> IterableObj for &'a EmptyCol<T>

Source§

type Item = &'a T

Type of the item that the iterators created by the boxed_iter method yields.
Source§

fn boxed_iter(&self) -> Box<dyn Iterator<Item = Self::Item> + '_>

Creates a new iterator in a box from this iterable yielding elements of type IterableObj::Item.

Auto Trait Implementations§

§

impl<T> Freeze for EmptyCol<T>

§

impl<T> RefUnwindSafe for EmptyCol<T>
where T: RefUnwindSafe,

§

impl<T> Send for EmptyCol<T>
where T: Send,

§

impl<T> Sync for EmptyCol<T>
where T: Sync,

§

impl<T> Unpin for EmptyCol<T>
where T: Unpin,

§

impl<T> UnwindSafe for EmptyCol<T>
where T: UnwindSafe,

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> SoM<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
Source§

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

Returns a mutable reference to self.
Source§

impl<T> SoR<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
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.