Trait core::str::pattern::ReverseSearcher [−][src]
pub unsafe trait ReverseSearcher<'a>: Searcher<'a> { fn next_back(&mut self) -> SearchStep; fn next_match_back(&mut self) -> Option<(usize, usize)> { ... } fn next_reject_back(&mut self) -> Option<(usize, usize)> { ... } }
🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
Expand description
Required methods
fn next_back(&mut self) -> SearchStep
[src]
fn next_back(&mut self) -> SearchStep
[src]🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
从后面开始执行下一个搜索步骤。
- 如果
haystack[a..b]
与模式匹配,则返回Match(a, b)
。 - 如果
haystack[a..b]
甚至部分不匹配,则返回Reject(a, b)
。 - 如果已访问 haystack 的每个字节,则返回
Done
直到 Done
的 Match
和 Reject
值流将包含相邻,不重叠,覆盖整个 haystack 并位于 utf8 边界上的索引范围。
Match
结果需要包含整个匹配的模式,但是 Reject
结果可以分为任意多个相邻的片段。两个范围的长度都可以为零。
例如,模式 "aaa"
和 haystack "cbaaaaab"
可能会产生流 [Reject(7, 8), Match(4, 7), Reject(1, 4), Reject(0, 1)]
。
Provided methods
fn next_match_back(&mut self) -> Option<(usize, usize)>
[src]
fn next_match_back(&mut self) -> Option<(usize, usize)>
[src]🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
查找下一个 Match
结果。
请参见 next_back()
。
fn next_reject_back(&mut self) -> Option<(usize, usize)>
[src]
fn next_reject_back(&mut self) -> Option<(usize, usize)>
[src]🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
查找下一个 Reject
结果。
请参见 next_back()
。
Implementors
🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
impl<'a, F> ReverseSearcher<'a> for CharPredicateSearcher<'a, F> where
F: FnMut(char) -> bool,
[src]
impl<'a, F> ReverseSearcher<'a> for CharPredicateSearcher<'a, F> where
F: FnMut(char) -> bool,
[src]🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized
🔬 This is a nightly-only experimental API. (pattern
#27721)
API not fully fleshed out and ready to be stabilized