Trait ArrayFromFn

Source
pub trait ArrayFromFn<T, const N: usize>: Array + AsSlice<Item = T> {
Show 14 methods // Required methods const fn from_fn<F>(fill: F) -> Self where F: FnMut(usize) -> T; const fn rfrom_fn<F>(fill: F) -> Self where F: FnMut(usize) -> T; const fn from_fn_boxed<F>(fill: F) -> Box<Self> where F: FnMut(usize) -> T; const fn rfrom_fn_boxed<F>(fill: F) -> Box<Self> where F: FnMut(usize) -> T; const fn from_fn_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A> where F: FnMut(usize) -> T, A: Allocator; const fn rfrom_fn_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A> where F: FnMut(usize) -> T, A: Allocator; const fn try_from_fn<F, E>(fill: F) -> Result<Self, E> where F: FnMut(usize) -> Result<T, E>; const fn try_rfrom_fn<F, E>(fill: F) -> Result<Self, E> where F: FnMut(usize) -> Result<T, E>; const fn try_from_fn_boxed<F, E>(fill: F) -> Result<Box<Self>, E> where F: FnMut(usize) -> Result<T, E>; const fn try_rfrom_fn_boxed<F, E>(fill: F) -> Result<Box<Self>, E> where F: FnMut(usize) -> Result<T, E>; const fn try_from_fn_boxed_in<F, E, A>( fill: F, alloc: A, ) -> Result<Box<Self, A>, E> where F: FnMut(usize) -> Result<T, E>, A: Allocator; const fn try_rfrom_fn_boxed_in<F, E, A>( fill: F, alloc: A, ) -> Result<Box<Self, A>, E> where F: FnMut(usize) -> Result<T, E>, A: Allocator; const async fn from_fn_async<F>(fill: F) -> Self where F: AsyncFn(usize) -> T; const async fn try_from_fn_async<F, E>(fill: F) -> Result<Self, E> where F: AsyncFn(usize) -> Result<T, E>;
}

Required Methods§

Source

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

Source

const fn rfrom_fn<F>(fill: F) -> Self
where F: FnMut(usize) -> T,

Source

const fn from_fn_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T,

Source

const fn rfrom_fn_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T,

Source

const fn from_fn_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T, A: Allocator,

Source

const fn rfrom_fn_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T, A: Allocator,

Source

const fn try_from_fn<F, E>(fill: F) -> Result<Self, E>
where F: FnMut(usize) -> Result<T, E>,

Source

const fn try_rfrom_fn<F, E>(fill: F) -> Result<Self, E>
where F: FnMut(usize) -> Result<T, E>,

Source

const fn try_from_fn_boxed<F, E>(fill: F) -> Result<Box<Self>, E>
where F: FnMut(usize) -> Result<T, E>,

Source

const fn try_rfrom_fn_boxed<F, E>(fill: F) -> Result<Box<Self>, E>
where F: FnMut(usize) -> Result<T, E>,

Source

const fn try_from_fn_boxed_in<F, E, A>( fill: F, alloc: A, ) -> Result<Box<Self, A>, E>
where F: FnMut(usize) -> Result<T, E>, A: Allocator,

Source

const fn try_rfrom_fn_boxed_in<F, E, A>( fill: F, alloc: A, ) -> Result<Box<Self, A>, E>
where F: FnMut(usize) -> Result<T, E>, A: Allocator,

Source

const async fn from_fn_async<F>(fill: F) -> Self
where F: AsyncFn(usize) -> T,

Source

const async fn try_from_fn_async<F, E>(fill: F) -> Result<Self, E>
where F: AsyncFn(usize) -> Result<T, E>,

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, const N: usize> ArrayFromFn<T, N> for [T; N]

Source§

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

Source§

fn rfrom_fn<F>(fill: F) -> Self
where F: FnMut(usize) -> T,

Source§

fn from_fn_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T,

Source§

fn rfrom_fn_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T,

Source§

fn from_fn_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T, A: Allocator,

Source§

fn rfrom_fn_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T, A: Allocator,

Source§

fn try_from_fn<F, E>(fill: F) -> Result<Self, E>
where F: FnMut(usize) -> Result<T, E>,

Source§

fn try_rfrom_fn<F, E>(fill: F) -> Result<Self, E>
where F: FnMut(usize) -> Result<T, E>,

Source§

fn try_from_fn_boxed<F, E>(fill: F) -> Result<Box<Self>, E>
where F: FnMut(usize) -> Result<T, E>,

Source§

fn try_rfrom_fn_boxed<F, E>(fill: F) -> Result<Box<Self>, E>
where F: FnMut(usize) -> Result<T, E>,

Source§

fn try_from_fn_boxed_in<F, E, A>(fill: F, alloc: A) -> Result<Box<Self, A>, E>
where F: FnMut(usize) -> Result<T, E>, A: Allocator,

Source§

fn try_rfrom_fn_boxed_in<F, E, A>(fill: F, alloc: A) -> Result<Box<Self, A>, E>
where F: FnMut(usize) -> Result<T, E>, A: Allocator,

Source§

async fn from_fn_async<F>(fill: F) -> Self
where F: AsyncFn(usize) -> T,

Source§

async fn try_from_fn_async<F, E>(fill: F) -> Result<Self, E>
where F: AsyncFn(usize) -> Result<T, E>,

Implementors§