Trait bones_ecs::UnwrapMany

source ·
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§

source

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

Unwrap all the items in an array.

Implementations on Foreign Types§

source§

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

source§

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

Implementors§