Trait toad_common::array::Trunc

source ·
pub trait Truncwhere
Self: Sized,
{ fn trunc(&mut self, len: usize); fn clear(&mut self) { ... } }
Expand description

Truncate this collection to a new length.

If self was shorter than len, nothing happens.

If self was longer, drops elements up to len

Required Methods§

source

fn trunc(&mut self, len: usize)

Provided Methods§

source

fn clear(&mut self)

Erase all elements in the collection

Implementations on Foreign Types§

source§

impl<T> Trunc for Vec<T>

source§

fn trunc(&mut self, len: usize)

source§

impl<T, const N: usize> Trunc for ArrayVec<[T; N]>where
T: Default,

source§

fn trunc(&mut self, len: usize)

Implementors§