pub trait VecExtensions<T> {
    // Required methods
    fn push_if_empty(self, value: T) -> Self;
    fn swap_insert(&mut self, index: usize, value: T);
}

Required Methods§

source

fn push_if_empty(self, value: T) -> Self

Pushes the provided value to the container if the container is empty

source

fn swap_insert(&mut self, index: usize, value: T)

Inserts the provided value at index while swapping the item at index to the end of the container

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> VecExtensions<T> for Vec<T>

source§

fn push_if_empty(self, value: T) -> Self

source§

fn swap_insert(&mut self, index: usize, value: T)

Implementors§