Struct parser_compose::Byte

source ·
pub struct Byte { /* private fields */ }
Expand description

A parser that recognizes an byte in the given range. See byte

Trait Implementations§

source§

impl<'input> Parser<&'input [u8], &'input [u8], ()> for Byte

source§

fn try_parse(&self, input: &'input [u8]) -> Res<&'input [u8], &'input [u8], ()>

Recognizes a value from the input and returns the result Read more
source§

fn map<F, M>(self, f: F) -> Map<Self, F, Out>where Self: Sized, F: Fn(Out) -> M,

Returns a new parser that calls the closure if it succeeds, providing the extracted value as an argument
source§

fn map_err<F, M>(self, f: F) -> MapErr<Self, F, E>where Self: Sized, F: Fn(Error<E>) -> Error<M>,

Returns a new parser which that calls the closure if it fails, providing the error as an argument
source§

fn or<P>(self, next: P) -> Or<Self, P>where Self: Sized,

Returns a new parser that succeeds when either the current or the next parser succeed
source§

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
source§

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 more
source§

fn optional(self) -> Optional<Self>where Self: Sized,

Returns a parser that succeeds even if it does not not recognize the input
source§

fn peeked(self) -> Peeked<Self>where Self: Sized,

Returns a parser that succeeds or fails with inner parser, but never consumes any input regardless of the outcome
source§

fn and_then<F, U>(self, f: F) -> AndThen<Self, F, Out>where Self: Sized, F: Fn(Out) -> Result<U, Error<E>>,

Auto Trait Implementations§

§

impl RefUnwindSafe for Byte

§

impl Send for Byte

§

impl Sync for Byte

§

impl Unpin for Byte

§

impl UnwindSafe for Byte

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.