-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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_bytesfind_bytesrfind_bytessplit_bytesrsplit_bytessplit_bytes_oncersplit_bytessplitn_bytesrsplitn_bytesreplace_bytesreplacen_bytesstarts_with_bytesends_with_bytesmatches_bytesrmatches_bytesmatch_indices_bytesrmatch_indices_bytestrim_bytes_start_matchestrim_bytes_end_matchesstrip_bytes_prefixstrip_bytes_suffix
Steps / History
- ACP: slice contains subslice libs-team#499 (comment), ACP: Pattern methods for
OsStrwithoutOsStrpatterns libs-team#311 - Implementation: #...
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Scripter17, StackOverflowExcept1on and wcampbell0x2aScripter17, caseykneale and hdoordt
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.