Skip to main content

CollectIn

Trait CollectIn 

Source
pub trait CollectIn: Iterator + Sized {
    // Provided method
    fn collect_in<C>(self, alloc: C::Alloc) -> C
       where C: FromIteratorIn<Self::Item> { ... }
}
Expand description

Collect an iterator into an arena-allocated collection.

The arena-equivalent of Iterator::collect:

let evens: Vec<i32, A> = (0..10).filter(|n| n % 2 == 0).collect_in(arena);

Provided Methods§

Source

fn collect_in<C>(self, alloc: C::Alloc) -> C
where C: FromIteratorIn<Self::Item>,

Collects this iterator into C, allocating its storage in alloc.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§