nom

Trait Slice

Source
pub trait Slice<R> {
    // Required method
    fn slice(&self, range: R) -> Self;
}
Expand description

Slicing operations using ranges.

This trait is loosely based on Index, but can actually return something else than a &[T] or &str

Required Methods§

Source

fn slice(&self, range: R) -> Self

Slices self according to the range argument

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> Slice<Range<usize>> for &'a str

Source§

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

Source§

impl<'a> Slice<RangeFrom<usize>> for &'a str

Source§

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

Source§

impl<'a> Slice<RangeFull> for &'a str

Source§

fn slice(&self, range: RangeFull) -> Self

Source§

impl<'a> Slice<RangeTo<usize>> for &'a str

Source§

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

Source§

impl<'a, T> Slice<Range<usize>> for &'a [T]

Source§

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

Source§

impl<'a, T> Slice<RangeFrom<usize>> for &'a [T]

Source§

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

Source§

impl<'a, T> Slice<RangeFull> for &'a [T]

Source§

fn slice(&self, range: RangeFull) -> Self

Source§

impl<'a, T> Slice<RangeTo<usize>> for &'a [T]

Source§

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

Implementors§