pub trait Splitable: Sized {
// Required methods
fn check_bound(&self, offset: usize) -> bool;
unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self);
// Provided methods
fn split_at(&self, offset: usize) -> (Self, Self) { ... }
unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self) { ... }
}
Required Methods§
fn check_bound(&self, offset: usize) -> bool
Sourceunsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)
unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)
Internal implementation of split_at_unchecked
. For any usage, prefer the using
split_at
or split_at_unchecked
.
§Safety
Safe if offset <= self.len()
.
Provided Methods§
Sourcefn split_at(&self, offset: usize) -> (Self, Self)
fn split_at(&self, offset: usize) -> (Self, Self)
Split Self
at offset
where offset <= self.len()
.
Sourceunsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)
unsafe fn split_at_unchecked(&self, offset: 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.