Skip to main content

Splitable

Trait Splitable 

Source
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§

Source

fn check_bound(&self, offset: usize) -> bool

Source

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§

Source

fn split_at(&self, offset: usize) -> (Self, Self)

Split Self at offset where offset <= self.len().

Source

unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)

Split Self at offset without checking offset <= self.len().

§Safety

Safe if offset <= self.len().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Splitable for Option<Bitmap>

Source§

fn check_bound(&self, offset: usize) -> bool

Source§

unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)

Source§

impl<T> Splitable for Buffer<T>

Source§

fn check_bound(&self, offset: usize) -> bool

Source§

unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)

Implementors§