Trait resize_slice::ResizeSlice [] [src]

pub trait ResizeSlice {
    fn resize(&mut self, start: usize, end: usize);
    fn resize_from(&mut self, start: usize);
    fn resize_to(&mut self, end: usize);
}

Extension trait that allows you to resize mutable slice references

Required Methods

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())

fn resize_from(&mut self, start: usize)

Resize to a new beginning offset

Panics

Panics if start > self.len()

fn resize_to(&mut self, end: usize)

Resize to a new length

Panics

Panics if end > self.len()

Implementors