pub trait Truncwhere
Self: Sized,{
// Required method
fn trunc(&mut self, len: usize);
// Provided method
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§
Provided Methods§
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.