Tracking Issue for byte_search
· Issue #134149 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Feature gate: #![feature(byte_search)]
acp: rust-lang/libs-team#499
This is a tracking issue for byte searching: searching for a particular pattern of bytes in a &[u8]
, and potentially trimming, splitting or otherwise processing the input based on the matches of the pattern.
Public API
The API mirrors the one for strings at std::str::pattern::Pattern.
pub trait BytePattern: Sized { /// Associated searcher for this pattern type Searcher<'a>: Searcher<'a>;
// etc.
}
and then adds a number of inherent methods for &[u8]
. The exact set has not yet been decided, but will likely include (modulo slight naming changes):
contains_bytes
find_bytes
rfind_bytes
split_bytes
rsplit_bytes
split_bytes_once
rsplit_bytes
splitn_bytes
rsplitn_bytes
replace_bytes
replacen_bytes
starts_with_bytes
ends_with_bytes
matches_bytes
rmatches_bytes
match_indices_bytes
rmatch_indices_bytes
trim_bytes_start_matches
trim_bytes_end_matches
strip_bytes_prefix
strip_bytes_suffix
Steps / History
- ACP: slice contains subslice libs-team#499 (comment), ACP: Pattern methods for OsStr without OsStr patterns libs-team#311
- Implementation: #...
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.