Skip to main content

ReadableOptionVec

Trait ReadableOptionVec 

Source
pub trait ReadableOptionVec<I: VecIndex, T: VecValue + Default> {
    // Required methods
    fn collect_or_default(&self) -> Vec<T>;
    fn collect_one_flat(&self, index: I) -> Option<T>;
}
Expand description

Extension methods for ReadableVec<I, Option<T>>.

Required Methods§

Source

fn collect_or_default(&self) -> Vec<T>

Collect all values, replacing None with T::default().

Source

fn collect_one_flat(&self, index: I) -> Option<T>

Flattens Option<Option<T>>Option<T>.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<V, I, T> ReadableOptionVec<I, T> for V
where V: ReadableVec<I, Option<T>> + Sized, I: VecIndex, T: VecValue + Default,