Trait FromNonEmptyIterator

Source
pub trait FromNonEmptyIterator<Item> {
    // Required method
    fn from_non_empty_iter<I: NonEmptyIntoIter<Item = Item>>(iter: I) -> Self;
}
Expand description

Creates collection from a non-empty iterator.

This is generally implemented for collections that are guaranteed to be non-empty.

Required Methods§

Source

fn from_non_empty_iter<I: NonEmptyIntoIter<Item = Item>>(iter: I) -> Self

Creates the collection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> FromNonEmptyIterator<T> for NonEmptyVec<T>

Available on crate feature alloc only.
Source§

impl<T, Item> FromNonEmptyIterator<Item> for NonEmpty<T>
where T: FromIterator<Item>,