Struct winnow::combinator::Span

source ·
pub struct Span<F, O> { /* private fields */ }
Expand description

Implementation of Parser::span

Trait Implementations§

source§

impl<I, O, E, F> Parser<I, Range<usize>, E> for Span<F, O>where I: Clone + Location, E: ParseError<I>, F: Parser<I, O, E>,

source§

fn parse_next(&mut self, input: I) -> IResult<I, Range<usize>, E>

Take tokens from the Stream, turning it into the output Read more
source§

fn by_ref(&mut self) -> ByRef<'_, Self>where Self: Sized,

Treat &mut Self as a parser Read more
source§

fn value<O2>(self, val: O2) -> Value<Self, O, O2>where Self: Sized, O2: Clone,

Produce the provided value Read more
source§

fn void(self) -> Void<Self, O>where Self: Sized,

Discards the output of the Parser Read more
source§

fn output_into<O2>(self) -> OutputInto<Self, O, O2>where Self: Sized, O: Into<O2>,

Convert the parser’s output to another type using std::convert::From Read more
source§

fn recognize(self) -> Recognize<Self, O>where Self: Sized,

Produce the consumed input as produced value. Read more
source§

fn with_recognized(self) -> WithRecognized<Self, O>where Self: Sized,

Produce the consumed input with the output Read more
source§

fn span(self) -> Span<Self, O>where Self: Sized, I: Location + Clone,

Produce the location of the consumed input as produced value. Read more
source§

fn with_span(self) -> WithSpan<Self, O>where Self: Sized, I: Location + Clone,

Produce the location of consumed input with the output Read more
source§

fn map<G, O2>(self, g: G) -> Map<Self, G, O>where G: Fn(O) -> O2, Self: Sized,

Maps a function over the output of a parser Read more
source§

fn map_res<G, O2, E2>(self, g: G) -> MapRes<Self, G, O>where Self: Sized, G: FnMut(O) -> Result<O2, E2>,

Applies a function returning a Result over the output of a parser. Read more
source§

fn verify_map<G, O2>(self, g: G) -> VerifyMap<Self, G, O>where Self: Sized, G: FnMut(O) -> Option<O2>,

source§

fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>where G: FnMut(O) -> H, H: Parser<I, O2, E>, Self: Sized,

Creates a parser from the output of this one Read more
source§

fn parse_to<O2>(self) -> ParseTo<Self, O, O2>where Self: Sized, O: ParseSlice<O2>,

Apply std::str::FromStr to the output of the parser Read more
source§

fn verify<G, O2: ?Sized>(self, second: G) -> Verify<Self, G, O2>where Self: Sized, G: Fn(&O2) -> bool,

Returns the output of the child parser if it satisfies a verification function. Read more
source§

fn context<C>(self, context: C) -> Context<Self, O, C>where Self: Sized, C: Clone + Debug, E: ContextError<I, C>,

If parsing fails, add context to the error Read more
source§

fn complete_err(self) -> CompleteErr<Self>where Self: Sized,

source§

fn err_into<E2>(self) -> ErrInto<Self, E, E2>where Self: Sized, E: Into<E2>,

Convert the parser’s error to another type using std::convert::From

Auto Trait Implementations§

§

impl<F, O> RefUnwindSafe for Span<F, O>where F: RefUnwindSafe, O: RefUnwindSafe,

§

impl<F, O> Send for Span<F, O>where F: Send, O: Send,

§

impl<F, O> Sync for Span<F, O>where F: Sync, O: Sync,

§

impl<F, O> Unpin for Span<F, O>where F: Unpin, O: Unpin,

§

impl<F, O> UnwindSafe for Span<F, O>where F: UnwindSafe, O: UnwindSafe,

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.