Struct parser_compose::AsciiStr
source · pub struct AsciiStr { /* private fields */ }
Expand description
A parser that recognizes an ascii str
in the given range. See
ascii_str
Trait Implementations§
source§impl<'input> Parser<&'input str, &'input str, ()> for AsciiStr
impl<'input> Parser<&'input str, &'input str, ()> for AsciiStr
source§fn try_parse(&self, input: &'input str) -> Res<&'input str, &'input str, ()>
fn try_parse(&self, input: &'input str) -> Res<&'input str, &'input str, ()>
Recognizes a value from the input and returns the result Read more
source§fn map<F, Mapped>(self, f: F) -> Map<Self, F, Out>where
Self: Sized,
F: Fn(Out) -> Mapped,
fn map<F, Mapped>(self, f: F) -> Map<Self, F, Out>where Self: Sized, F: Fn(Out) -> Mapped,
Returns a parser that maps a
Parser<In, Out, E>
to Parser<In, Mapped, E>
by applying a
function to the result of the parser if it succeeded. Read moresource§fn map_err<F, M>(self, f: F) -> MapErr<Self, F, E>where
Self: Sized,
F: Fn(Error<E>) -> Error<M>,
fn map_err<F, M>(self, f: F) -> MapErr<Self, F, E>where Self: Sized, F: Fn(Error<E>) -> Error<M>,
Returns a parser that maps a
Parser<In, Out, E>
to Parser<In, Out, Mapped>
by applying
a function to the error reported by the parser if it failed. Read moresource§fn when<F>(self, pred: F) -> Predicate<Self, F>where
Self: Sized,
F: Fn(Out) -> bool,
fn when<F>(self, pred: F) -> Predicate<Self, F>where Self: Sized, F: Fn(Out) -> bool,
Returns a new parser that succeeds if the predicate returns true. The predicate is given the
extracted value of the current parser as an argument Read more
source§fn repeated<R: RepetitionArgument>(self, count: R) -> Repeat<Self, R>where
Self: Sized,
fn repeated<R: RepetitionArgument>(self, count: R) -> Repeat<Self, R>where Self: Sized,
Returns a parser that suceeds if it is able to repeat
count
times. Read moresource§fn optional(self) -> Optional<Self>where
Self: Sized,
fn optional(self) -> Optional<Self>where Self: Sized,
Returns a parser always succeeds but wraps the output in an
Option<Out>
. If the original
parser would have failed, the parser outputs a None
. Read moresource§fn peeked(self) -> Peeked<Self>where
Self: Sized,
fn peeked(self) -> Peeked<Self>where Self: Sized,
Returns a parser that succeeds or fails as normal, but never consumes any input
regardless of the outcome. This can be used to look ahead. Read more
source§fn not_peeked(self) -> NotPeeked<Self, Out>where
Self: Sized,
fn not_peeked(self) -> NotPeeked<Self, Out>where Self: Sized,
Auto Trait Implementations§
impl RefUnwindSafe for AsciiStr
impl Send for AsciiStr
impl Sync for AsciiStr
impl Unpin for AsciiStr
impl UnwindSafe for AsciiStr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more