Trait toad_common::array::Filled

source ·
pub trait Filled<T>: Sized {
    fn filled_using<F>(f: F) -> Option<Self>
    where
        F: Fn() -> T
; 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,

Implementations on Foreign Types§

source§

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

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§