Trait ResizeSlice

Source
pub trait ResizeSlice {
    // Required methods
    fn resize(&mut self, start: usize, end: usize);
    fn resize_from(&mut self, start: usize);
    fn resize_to(&mut self, end: usize);
}
Expand description

Extension trait that allows you to resize mutable slice references

Required Methods§

Source

fn resize(&mut self, start: usize, end: usize)

Resizes the slice to start offset and end - start len

§Panics

Panics on out of bounds resize (start <= end <= self.len())

Source

fn resize_from(&mut self, start: usize)

Resize to a new beginning offset

§Panics

Panics if start > self.len()

Source

fn resize_to(&mut self, end: usize)

Resize to a new length

§Panics

Panics if end > self.len()

Implementations on Foreign Types§

Source§

impl<'a, T> ResizeSlice for &'a [T]

Source§

fn resize(&mut self, start: usize, end: usize)

Source§

fn resize_from(&mut self, start: usize)

Source§

fn resize_to(&mut self, end: usize)

Source§

impl<'a, T> ResizeSlice for &'a mut [T]

Source§

fn resize(&mut self, start: usize, end: usize)

Source§

fn resize_from(&mut self, start: usize)

Source§

fn resize_to(&mut self, end: usize)

Implementors§