rune::alloc::iter

Trait TryFromIteratorIn

Source
pub trait TryFromIteratorIn<T, A>: Sized
where A: Allocator,
{ // Required method fn try_from_iter_in<I>(iter: I, alloc: A) -> Result<Self, Error> where I: IntoIterator<Item = T>; }
Expand description

Conversion from an Iterator within a custom allocator A.

By implementing TryFromIteratorIn for a type, you define how it will be created from an iterator. This is common for types which describe a collection of some kind.

Required Methods§

Source

fn try_from_iter_in<I>(iter: I, alloc: A) -> Result<Self, Error>
where I: IntoIterator<Item = T>,

Creates a value from an iterator within an allocator.

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.

Implementations on Foreign Types§

Source§

impl<T, U, E, A> TryFromIteratorIn<Result<T, E>, A> for Result<U, E>
where A: Allocator, U: TryFromIteratorIn<T, A>,

Source§

fn try_from_iter_in<I>(iter: I, alloc: A) -> Result<Result<U, E>, Error>
where I: IntoIterator<Item = Result<T, E>>,

Implementors§

Source§

impl TryFromIteratorIn<Value, Global> for OwnedTuple

Source§

impl TryFromIteratorIn<Value, Global> for Stack

Source§

impl<'a, A> TryFromIteratorIn<&'a str, A> for String<A>
where A: Allocator,

Source§

impl<A> TryFromIteratorIn<char, A> for String<A>
where A: Allocator,

Source§

impl<C, A> TryFromIteratorIn<C, A> for ItemBuf<A>
where A: Allocator, C: IntoComponent,

Source§

impl<K, V, A> TryFromIteratorIn<(K, V), A> for BTreeMap<K, V, A>
where A: Allocator, K: Ord,

Source§

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

Source§

impl<T, A> TryFromIteratorIn<T, A> for BTreeSet<T, A>
where A: Allocator, T: Ord,

Source§

impl<T, A> TryFromIteratorIn<T, A> for Box<[T], A>
where A: Allocator,

Source§

impl<T, A> TryFromIteratorIn<T, A> for Vec<T, A>
where A: Allocator,

Source§

impl<T, A> TryFromIteratorIn<T, A> for VecDeque<T, A>
where A: Allocator,

Source§

impl<T, S, A> TryFromIteratorIn<T, A> for HashSet<T, S, A>
where A: Allocator, T: Eq + Hash, S: BuildHasher + Default,