alloc::str::pattern::DoubleEndedSearcher - Rust
Description: API documentation for the Rust `DoubleEndedSearcher` trait in crate `alloc`.
Keywords: rust, rustlang, rust-lang, DoubleEndedSearcher

# Trait alloc::str::pattern::DoubleEndedSearcher [−] [src]

    pub trait DoubleEndedSearcher<'a>: ReverseSearcher<'a> { }

🔬 This is a nightly-only experimental API. (`pattern` #27721)

API not fully fleshed out and ready to be stabilized

A marker trait to express that a `ReverseSearcher` can be used for a `DoubleEndedIterator` implementation.

For this, the impl of `Searcher` and `ReverseSearcher` need to follow these conditions:

- All results of `next()` need to be identical to the results of `next_back()` in reverse order.
- `next()` and `next_back()` need to behave as the two ends of a range of values, that is they can not "walk past each other".

# Examples

`char::Searcher` is a `DoubleEndedSearcher` because searching for a `char` only requires looking at one at a time, which behaves the same from both ends.

`(&str)::Searcher` is not a `DoubleEndedSearcher` because the pattern `"aa"` in the haystack `"aaa"` matches as either `"[aa]a"` or `"a[aa]"`, depending from which side it is searched.

## Implementors

- [src]
  `impl<'a> DoubleEndedSearcher<'a> for CharSearcher<'a>`
- [src]
  `impl<'a, F> DoubleEndedSearcher<'a> for CharPredicateSearcher<'a, F> where
  F: FnMut(char) -> bool,`
- [src]
  `impl<'a, 'b> DoubleEndedSearcher<'a> for CharSliceSearcher<'a, 'b>`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
↑
  Move up in search results
↓
  Move down in search results
↹
  Switch tab
⏎
  Go to active search result
+ / -
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)