VecOp

Trait VecOp 

Source
pub trait VecOp<T>: Default + Deref<Target = [T]> {
    // Required methods
    fn push_back(&mut self, item: T) -> Result<(), T>;
    fn clear(&mut self);
    fn insert(&mut self, index: usize, item: T) -> Result<(), T>;
    fn remove(&mut self, index: usize) -> T;
    fn drain<R>(&mut self, range: R) -> impl Iterator<Item = T>
       where R: RangeBounds<usize>;
}

Required Methods§

Source

fn push_back(&mut self, item: T) -> Result<(), T>

Source

fn clear(&mut self)

Source

fn insert(&mut self, index: usize, item: T) -> Result<(), T>

Source

fn remove(&mut self, index: usize) -> T

Source

fn drain<R>(&mut self, range: R) -> impl Iterator<Item = T>
where R: RangeBounds<usize>,

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> VecOp<T> for Vec<T>

Available on crate feature alloc only.
Source§

fn push_back(&mut self, item: T) -> Result<(), T>

Source§

fn clear(&mut self)

Source§

fn insert(&mut self, index: usize, item: T) -> Result<(), T>

Source§

fn remove(&mut self, index: usize) -> T

Source§

fn drain<R>(&mut self, range: R) -> impl Iterator<Item = T>
where R: RangeBounds<usize>,

Source§

impl<T, const C: usize> VecOp<T> for Vec<T, C>

Source§

fn push_back(&mut self, item: T) -> Result<(), T>

Source§

fn clear(&mut self)

Source§

fn insert(&mut self, index: usize, item: T) -> Result<(), T>

Source§

fn remove(&mut self, index: usize) -> T

Source§

fn drain<R>(&mut self, range: R) -> impl Iterator<Item = T>
where R: RangeBounds<usize>,

Implementors§