pub trait SplitableSpanHelpers: Clone {
// Required method
fn truncate_h(&mut self, at: usize) -> Self;
// Provided methods
fn truncate_keeping_right_h(&mut self, at: usize) -> Self { ... }
fn split(self, at: usize) -> (Self, Self) { ... }
}Required Methods§
Sourcefn truncate_h(&mut self, at: usize) -> Self
fn truncate_h(&mut self, at: usize) -> Self
Split the entry, returning the part of the entry which was jettisoned. After truncating at
pos, self.len() == pos and the returned value contains the rest of the items.
ⓘ
let initial_len = entry.len();
let rest = entry.truncate(truncate_at);
assert!(initial_len == truncate_at + rest.len());at parameter must strictly obey 0 < at < entry.len()
Provided Methods§
Sourcefn truncate_keeping_right_h(&mut self, at: usize) -> Self
fn truncate_keeping_right_h(&mut self, at: usize) -> Self
The inverse of truncate. This method mutably truncates an item, keeping all content from at..item.len() and returning the item range from 0..at.
fn split(self, at: usize) -> (Self, Self)
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.