Segmentable

Trait Segmentable 

Source
pub trait Segmentable: Ord + Sized {
    // Required methods
    fn split(self, at: usize) -> Option<(Self, Self)>;
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

An item that can be segmented into parts.

Required Methods§

Source

fn split(self, at: usize) -> Option<(Self, Self)>

Split the item into two parts.

Source

fn len(&self) -> usize

Get the length of the item.

Provided Methods§

Source

fn is_empty(&self) -> bool

Tell if the item is empty.

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.

Implementations on Foreign Types§

Source§

impl<'a> Segmentable for &'a str

Source§

fn split(self, at: usize) -> Option<(Self, Self)>

Source§

fn len(&self) -> usize

Source§

impl<'a, T: Ord> Segmentable for &'a [T]

Source§

fn split(self, at: usize) -> Option<(Self, Self)>

Source§

fn len(&self) -> usize

Implementors§