Trait nom::lib::std::slice::SlicePattern[][src]

pub trait SlicePattern {
    type Item;
    pub fn as_slice(&self) -> &[Self::Item];
}
🔬 This is a nightly-only experimental API. (slice_pattern)

stopgap trait for slice patterns

Patterns in slices - currently, only used by strip_prefix and strip_suffix. At a future point, we hope to generalise core::str::Pattern (which at the time of writing is limited to str) to slices, and then this trait will be replaced or abolished.

Associated Types

type Item[src]

🔬 This is a nightly-only experimental API. (slice_pattern)

stopgap trait for slice patterns

The element type of the slice being matched on.

Loading content...

Required methods

pub fn as_slice(&self) -> &[Self::Item][src]

🔬 This is a nightly-only experimental API. (slice_pattern)

stopgap trait for slice patterns

Currently, the consumers of SlicePattern need a slice.

Loading content...

Implementors

impl<T> SlicePattern for [T]1.51.0[src]

type Item = T

🔬 This is a nightly-only experimental API. (slice_pattern)

stopgap trait for slice patterns

impl<T, const N: usize> SlicePattern for [T; N]1.51.0[src]

type Item = T

🔬 This is a nightly-only experimental API. (slice_pattern)

stopgap trait for slice patterns

Loading content...