Skip to main content

FromNonEmptyIterator

Trait FromNonEmptyIterator 

Source
pub trait FromNonEmptyIterator<T>: Sized {
    // Required method
    fn from_nonempty_iter<I>(iter: I) -> Self
       where I: IntoNonEmptyIterator<Item = T>;
}
Expand description

Conversion from a NonEmptyIterator.

Required Methods§

Source

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = T>,

Creates a value from a NonEmptyIterator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromNonEmptyIterator<()> for ()

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = ()>,

Source§

impl FromNonEmptyIterator<String> for String

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = String>,

Source§

impl FromNonEmptyIterator<char> for String

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = char>,

Source§

impl<'a> FromNonEmptyIterator<&'a char> for String

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = &'a char>,

Source§

impl<'a> FromNonEmptyIterator<&'a str> for String

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = &'a str>,

Source§

impl<'a> FromNonEmptyIterator<Cow<'a, str>> for String

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = Cow<'a, str>>,

Source§

impl<A, E, V> FromNonEmptyIterator<Result<A, E>> for Result<V, E>

Source§

fn from_nonempty_iter<I>(iter: I) -> Result<V, E>
where I: IntoNonEmptyIterator<Item = Result<A, E>>,

Source§

impl<K, V, S> FromNonEmptyIterator<(K, V)> for HashMap<K, V, S>
where K: Eq + Hash, S: BuildHasher + Default,

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = (K, V)>,

Source§

impl<K, V> FromNonEmptyIterator<(K, V)> for BTreeMap<K, V>
where K: Ord,

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = (K, V)>,

Source§

impl<P> FromNonEmptyIterator<P> for PathBuf
where P: AsRef<Path>,

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = P>,

Source§

impl<T, S> FromNonEmptyIterator<T> for HashSet<T, S>
where T: Eq + Hash, S: BuildHasher + Default,

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = T>,

Source§

impl<T> FromNonEmptyIterator<T> for BTreeSet<T>
where T: Ord,

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = T>,

Source§

impl<T> FromNonEmptyIterator<T> for Vec<T>

Source§

fn from_nonempty_iter<I>(iter: I) -> Self
where I: IntoNonEmptyIterator<Item = T>,

Implementors§

Source§

impl<K, V, S> FromNonEmptyIterator<(K, V)> for NEIndexMap<K, V, S>
where K: Eq + Hash, S: BuildHasher + Default,

use nonempty_collections::*;

let v = nev![('a', 1), ('b', 2), ('c', 3), ('a', 4)];
let m0 = v.into_nonempty_iter().collect::<NEIndexMap<_, _>>();
let m1 = neim! {'a' => 4, 'b' => 2, 'c' => 3};
assert_eq!(m0, m1);
Source§

impl<K, V, S> FromNonEmptyIterator<(K, V)> for NEMap<K, V, S>
where K: Eq + Hash, S: BuildHasher + Default,

use nonempty_collections::*;

let v = nev![('a', 1), ('b', 2), ('c', 3), ('a', 4)];
let m0: NEMap<_, _> = v.into_nonempty_iter().collect();
let m1: NEMap<_, _> = nem!['a' => 4, 'b' => 2, 'c' => 3];
assert_eq!(m0, m1);
Source§

impl<K, V> FromNonEmptyIterator<(K, V)> for NEBTreeMap<K, V>
where K: Ord,

use nonempty_collections::*;

let v = nev![('a', 1), ('b', 2), ('c', 3), ('a', 4)];
let m0: NEBTreeMap<_, _> = v.into_nonempty_iter().collect();
let m1: NEBTreeMap<_, _> = nebtm!['a' => 4, 'b' => 2, 'c' => 3];
assert_eq!(m0, m1);
Source§

impl<T, S> FromNonEmptyIterator<T> for NEIndexSet<T, S>
where T: Eq + Hash, S: BuildHasher + Default,

use nonempty_collections::*;

let s0 = neis![1, 2, 3];
let s1: NEIndexSet<_> = s0.nonempty_iter().cloned().collect();
assert_eq!(s0, s1);
Source§

impl<T, S> FromNonEmptyIterator<T> for NESet<T, S>
where T: Eq + Hash, S: BuildHasher + Default,

use nonempty_collections::*;

let s0 = nes![1, 2, 3];
let s1: NESet<_> = s0.nonempty_iter().cloned().collect();
assert_eq!(s0, s1);
Source§

impl<T> FromNonEmptyIterator<T> for NEBTreeSet<T>
where T: Ord,

use nonempty_collections::*;

let s0 = nebts![1, 2, 3];
let s1: NEBTreeSet<_> = s0.nonempty_iter().cloned().collect();
assert_eq!(s0, s1);
Source§

impl<T> FromNonEmptyIterator<T> for NEVec<T>

use nonempty_collections::*;

let v0 = nev![1, 2, 3];
let v1: NEVec<_> = v0.nonempty_iter().cloned().collect();
assert_eq!(v0, v1);