Trait bones_lib::prelude::UnwrapMany

pub trait UnwrapMany<const N: usize, T> {
    // Required method
    fn unwrap_many(self) -> [T; N];
}
Expand description

Helper trait for unwraping each item in an array.

§Example

let data = [Some(1), Some(2)];
let [data1, data2] = data.unwrap_many();

Required Methods§

fn unwrap_many(self) -> [T; N]

Unwrap all the items in an array.

Implementations on Foreign Types§

§

impl<const N: usize, T> UnwrapMany<N, T> for [Option<T>; N]

§

fn unwrap_many(self) -> [T; N]

§

impl<const N: usize, T, E> UnwrapMany<N, T> for [Result<T, E>; N]
where E: Debug,

§

fn unwrap_many(self) -> [T; N]

Implementors§