Skip to main content

FromIteratorIn

Trait FromIteratorIn 

Source
pub trait FromIteratorIn<T> {
    type Alloc;

    // Required method
    fn from_iter_in<I>(iter: I, alloc: Self::Alloc) -> Self
       where I: IntoIterator<Item = T>;
}
Expand description

Construct a collection from an iterator, allocating its storage in an arena.

The arena-equivalent of FromIterator: the implementing collection decides what allocator handle it needs via Alloc.

Required Associated Types§

Source

type Alloc

The allocator handle the collection is built into (e.g. &'arena A).

Required Methods§

Source

fn from_iter_in<I>(iter: I, alloc: Self::Alloc) -> Self
where I: IntoIterator<Item = T>,

Builds Self from iter, allocating into alloc.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<'arena, K, V, A, S> FromIteratorIn<(K, V)> for HashMap<'arena, K, V, A, S>
where K: Eq + Hash, S: BuildHasher + Default, A: Arena,

Source§

impl<'arena, T, A, S> FromIteratorIn<T> for HashSet<'arena, T, A, S>
where T: Eq + Hash, S: BuildHasher + Default, A: Arena,

Source§

impl<'arena, T, A: Arena> FromIteratorIn<T> for Vec<'arena, T, A>