pub trait BoundedFromFn<T, N: Get<u32>>: Sized {
// Required method
fn from_fn(len: usize, f: impl FnMut(usize) -> T) -> Self;
// Provided methods
fn from_fn_fill(f: impl FnMut(usize) -> T) -> Self { ... }
fn default_fill() -> Self
where T: Default { ... }
}Expand description
Constructor for bounded vectors built from an index function.
Required Methods§
Provided Methods§
Sourcefn from_fn_fill(f: impl FnMut(usize) -> T) -> Self
fn from_fn_fill(f: impl FnMut(usize) -> T) -> Self
Build a vector filled up to the bound, where element i is f(i).
Sourcefn default_fill() -> Selfwhere
T: Default,
fn default_fill() -> Selfwhere
T: Default,
Build a vector filled up to the bound with default elements.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".