Skip to main content

CollectTo

Trait CollectTo 

Source
pub trait CollectTo<T>: Sized + IntoIterator<Item = T> {
    // Provided methods
    fn to_vec(self) -> Vec<T> { ... }
    fn to_linkedlist(self) -> LinkedList<T> { ... }
    fn to_vecdeque(self) -> VecDeque<T> { ... }
    fn to_hashset(self) -> HashSet<T>
       where T: Eq + Hash { ... }
    fn to_btreeset(self) -> BTreeSet<T>
       where T: Ord { ... }
}

Provided Methods§

Source

fn to_vec(self) -> Vec<T>

Source

fn to_linkedlist(self) -> LinkedList<T>

Source

fn to_vecdeque(self) -> VecDeque<T>

Source

fn to_hashset(self) -> HashSet<T>
where T: Eq + Hash,

Source

fn to_btreeset(self) -> BTreeSet<T>
where T: Ord,

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<I, T> CollectTo<T> for I
where I: IntoIterator<Item = T>,