SlicePattern in core::slice - Rust (original) (raw)
pub trait SlicePattern {
type Item;
// Required method
fn as_slice(&self) -> &[Self::Item];
}
🔬This is a nightly-only experimental API. (slice_pattern
#56345)
Expand description
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 tostr
) to slices, and then this trait will be replaced or abolished.
🔬This is a nightly-only experimental API. (slice_pattern
#56345)
The element type of the slice being matched on.
🔬This is a nightly-only experimental API. (slice_pattern
#56345)
Currently, the consumers of SlicePattern
need a slice.