Trait hybrid_array::FromFn

source ·
pub trait FromFn<T>: Sized {
    // Required method
    fn from_fn<F>(cb: F) -> Self
       where F: FnMut(usize) -> T;
}
Expand description

Construct an array type from the given function.

Required Methods§

source

fn from_fn<F>(cb: F) -> Self
where F: FnMut(usize) -> T,

Create array using the given callback function for each element.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

fn from_fn<F>(cb: F) -> Self
where F: FnMut(usize) -> T,

Implementors§

source§

impl<T, U> FromFn<T> for Array<T, U>
where U: ArraySize,