Trait IsViewBuildable

Source
pub trait IsViewBuildable: Sized {
    // Required methods
    fn apply_view(&mut self, view: &View) -> Result<()>;
    fn from_view(&self, view: &View) -> Result<Self>;
}
Expand description

IsViewBuildable trait used for types which can be constructed from a view / have a view applied to them

Required Methods§

Source

fn apply_view(&mut self, view: &View) -> Result<()>

Should apply the view and only keep items indexed within the view. Should return an error if any index is out of bounds

Source

fn from_view(&self, view: &View) -> Result<Self>

Should create a new object consisting only of items indexed within the view. Should return an error if any index is out of bounds

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> IsViewBuildable for LinkedList<T>
where T: Clone,

Source§

fn apply_view(&mut self, view: &View) -> Result<()>

Source§

fn from_view(&self, view: &View) -> Result<Self>

Source§

impl<T> IsViewBuildable for VecDeque<T>
where T: Clone,

Source§

fn apply_view(&mut self, view: &View) -> Result<()>

Source§

fn from_view(&self, view: &View) -> Result<Self>

Source§

impl<T> IsViewBuildable for Vec<T>
where T: Clone,

Source§

fn apply_view(&mut self, view: &View) -> Result<()>

Source§

fn from_view(&self, view: &View) -> Result<Self>

Implementors§