Skip to main content

Slice

Trait Slice 

Source
pub trait Slice<'s>:
    AsRef<str>
    + Clone
    + PartialEq {
    // Required methods
    fn slice(&self, range: Range<usize>) -> Self;
    fn trim(&mut self);
}

Required Methods§

Source

fn slice(&self, range: Range<usize>) -> Self

Source

fn trim(&mut self)

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 Slice<'_> for String

Source§

fn slice(&self, range: Range<usize>) -> Self

Source§

fn trim(&mut self)

Source§

impl<'s> Slice<'s> for &'s str

Source§

fn slice(&self, range: Range<usize>) -> Self

Source§

fn trim(&mut self)

Implementors§