Skip to main content

Filled

Trait Filled 

Source
pub trait Filled<T>: Sized {
    // Required method
    fn filled_using<F>(f: F) -> Option<Self>
       where F: Fn() -> T;

    // Provided methods
    fn filled(t: T) -> Option<Self>
       where T: Copy { ... }
    fn filled_default() -> Option<Self>
       where T: Default { ... }
}
Expand description

Fill this collection to the end with copies of t, copying array initialization [0u8; 1000] to the Array trait.

If the collection has no end (e.g. Vec), this trait’s methods will return None.

Required Methods§

Source

fn filled_using<F>(f: F) -> Option<Self>
where F: Fn() -> T,

Provided Methods§

Source

fn filled(t: T) -> Option<Self>
where T: Copy,

Source

fn filled_default() -> Option<Self>
where T: Default,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Filled<T> for Vec<T>

Available on crate feature alloc only.
Source§

fn filled_using<F>(_: F) -> Option<Self>
where F: Fn() -> T,

Source§

impl<T, const N: usize> Filled<T> for ArrayVec<[T; N]>
where T: Default,

Source§

fn filled_using<F>(f: F) -> Option<Self>
where F: Fn() -> T,

Source§

fn filled(t: T) -> Option<Self>
where T: Copy,

Implementors§