CharStrPredicate

Trait CharStrPredicate 

Source
pub trait CharStrPredicate<B: FallibleBool>: FnMut(char, &str) -> B + Sized {
    // Provided method
    fn expecting(self, len: usize) -> SizedCharStrPredicate<Self, B> { ... }
}
Expand description

Convert FnMut(char, &str) -> FalliableBool into a pattern by specifying a look-ahead length.

Provided Methods§

Source

fn expecting(self, len: usize) -> SizedCharStrPredicate<Self, B>

Returns a pattern by giving a length hint on a string predicate

§Note
  • All chars above position zero are obtained through peeking
  • Do not expect all incoming strings to be length len, the user is expected to handle edge cases.
§Panics

if len is 0

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§