Struct Boxed

Source
pub struct Boxed<P: ?Sized>(/* private fields */);
Expand description

The result of the boxed function in the BoxedParserExt trait

Trait Implementations§

Source§

impl<'p, T, E> Parser<T, E> for Boxed<dyn Parser<T, E> + 'p>

Source§

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, T, E>

Auto Trait Implementations§

§

impl<P> Freeze for Boxed<P>
where P: ?Sized,

§

impl<P> RefUnwindSafe for Boxed<P>
where P: RefUnwindSafe + ?Sized,

§

impl<P> Send for Boxed<P>
where P: Send + ?Sized,

§

impl<P> Sync for Boxed<P>
where P: Sync + ?Sized,

§

impl<P> Unpin for Boxed<P>
where P: ?Sized,

§

impl<P> UnwindSafe for Boxed<P>
where P: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<'p, T, E, P> BoxedParserExt<'p, T, E> for P
where T: 'p, E: 'p, P: Parser<T, E> + 'p,

Source§

fn boxed(self) -> Boxed<dyn Parser<T, E> + 'p>

Convert a parser into a dynamically dispatched parser Read more
Source§

fn ref_parser(&'p self) -> Referenced<'p, Self, E>

Convert a parser into a dynamically dispatched parser Read more
Source§

impl<T, E, P> ConcatParserExt<T, E> for P
where T: Concat + Clone, P: Parser<T, E>,

Source§

fn multiple(self) -> Multiple<Self, E>

Repeat a parser one or more times Read more
Source§

fn maybe(self) -> Maybe<Self, E>

Use a parser once or not at all Read more
Source§

fn and<P: Parser<T, E>>(self, other: P) -> And<Self, P, E>

Use one parser after another parser Read more
Source§

fn repeated<R: RangeBounds<usize> + Clone>( self, repetitions: R, ) -> Repeat<Self, R, E>

Repeat a parser for a specified number of times 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 T
where 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, E, P> ListParserExt<T, E> for P
where P: Parser<List<T>, E>,

Source§

fn collect<I: FromIterator<T>>(self) -> Collect<Self, T, I, E>

Collect a unqiely parsed list into a different kind of container Read more
Source§

impl<T, E, P> ParserExt<T, E> for P
where P: Parser<T, E>,

Source§

fn or<P: Parser<T, E>>(self, other: P) -> Or<Self, P, E>

Evaluate two alternative parsers producing all successful parses from both Read more
Source§

fn map<V, F: Fn(T) -> V>(self, map: F) -> Map<Self, F, T, E>

Map the output of a parser to a new value and type Read more
Source§

fn and_then<V, Q: Parser<V, E>, F: Fn(T) -> Q>( self, map: F, ) -> AndThen<Self, F, T, E>

Apply an additional parser dependant on the result of the preceding parser Read more
Source§

fn fold<P: Parser<T, E>, F: Fn(T) -> P>(self, fold: F) -> Fold<Self, F, E>

Repeatedly apply a parser using it to extend the previous results of the parse Read more
Source§

fn on_failure<P: Parser<T, E>>(self, other: P) -> OnFailure<Self, P, E>

Apply an alternative parser if the preceding parser produces errors or no successful parses Read more
Source§

fn on_none<P: Parser<T, E>>(self, other: P) -> OnNone<Self, P, E>

Apply an alternative parser if the preceding parser produces no successful parses Read more
Source§

fn drop<V, P: Parser<V, E>>(self, other: P) -> Drop<Self, P, V, E>

Apply an additional parser and discard the result Read more
Source§

fn maybe_drop<V, P: Parser<V, E>>(self, other: P) -> MaybeDrop<Self, P, V, E>

Apply an additional parser and discard any result Read more
Source§

fn skip<V, P: Parser<V, E>>(self, keep: P) -> Skip<Self, P, T, E>

Apply an additional parser and take its output instead Read more
Source§

fn condition<F: Fn(&T) -> bool>(self, condition: F) -> Condition<Self, F, E>

Only parse successfully if the output of the parser satisfies a given condition Read more
Source§

fn end(self) -> End<Self, E>

Only parse successfully if there is no text remaining in the input after a parse Read more
Source§

fn catch(self) -> Catch<Self, E>

Transform all exceptions in the result into errors, moving the start of the associated range to the start of the given parser. Read more
Source§

fn meta(self) -> MetaMap<Self, E>

Wrap the output of a parser with the location of the input parsed Read more
Source§

fn to_list(self) -> ListMap<Self, E>

Wrap the value of a parser in a list Read more
Source§

fn delimited_by<D, P: Parser<D, E>, R: RangeBounds<usize>>( self, delimiter: P, repetitions: R, ) -> DelimitedBy<Self, P, D, R, E>

Repeat the parser a given number of times with the provided delimeter with an optional trailing delimeter Read more
Source§

fn strictly_delimited_by<D, P: Parser<D, E>, R: RangeBounds<usize>>( self, delimiter: P, repetitions: R, ) -> StrictlyDelimitedBy<Self, P, D, R, E>

Repeat the parser a given number of times with the provided delimeter Read more
Source§

fn surrounded_by<O: Clone, C: Clone, OP: Parser<O, E>, CP: Parser<C, E>>( self, open: OP, close: CP, ) -> SurroundedBy<Self, OP, CP, O, C, E>

Enclose the parser in the given open and close delimeters Read more
Source§

fn pair<B, P: Parser<B, E>>(self, other: P) -> Pair<Self, P, E>

Parse two parsers and collect them in a tuple Read more
Source§

fn space_after(self) -> SpaceAfter<Self, E>

Ignore the space that always appears after the parser Read more
Source§

fn maybe_space_after(self) -> MaybeSpaceAfter<Self, E>

Ignore the space that might appear after the parser Read more
Source§

fn space_before(self) -> SpaceBefore<Self, E>

Ignore the space that always appears before the parser
Source§

fn maybe_space_before(self) -> MaybeSpaceBefore<Self, E>

Ignore the space that might appear before the parser
Source§

fn space_around(self) -> SpaceAround<Self, E>

Ignore the space that always appears before and after the parser
Source§

fn maybe_space_around(self) -> MaybeSpaceAround<Self, E>

Ignore the space that might appear before or after the parser Read more
Source§

impl<E, P> TextParserExt<E> for P
where P: Parser<Span, E>,

Source§

fn copy_string(self) -> StringMap<Self, E>

Convert the list of characters into a string within a parser Read more
Source§

fn str_condition<F: Fn(&str) -> bool>(self, f: F) -> StrCondition<Self, F, E>

Only parse successfully if there is no text remaining in the input after a parse Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.