ParsingInput

Struct ParsingInput 

Source
pub struct ParsingInput<T, O, F> { /* private fields */ }
Expand description

Parsing state holds an Input.

Implementations§

Source§

impl<T, O, F> ParsingInput<T, O, F>

Source

pub fn cursor(&self) -> impl Deref<Target = Cursor<T>> + '_

Get the reference of Cursor.

Source

pub fn cursor_mut(&mut self) -> impl DerefMut<Target = Cursor<T>> + '_

Get the mutable reference of Cursor.

Source

pub fn result_mut(&mut self) -> Option<&mut O>

Get the result of the parser.

Source

pub fn into_input(self) -> Box<Input<T>>

Break the ParsingInput into Input.

Source§

impl<T, O, F> ParsingInput<T, O, F>
where F: Future<Output = O>,

Source

pub fn new<'a, P: Parser<'a, T, O, F>>(input: Box<Input<T>>, parser: P) -> Self
where T: 'a, F: 'a,

Start parsing with a parser.

Source

pub fn poll(&mut self) -> bool
where F: Unpin,

Run the parser. Return true if the parser is done. You shouldn’t call this anymore. It may leads to panic or never return. Return false if the parser is pending. You should add more items to the buffer.

Trait Implementations§

Source§

impl<T: Debug, O: Debug, F: Debug> Debug for ParsingInput<T, O, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, O, F> Freeze for ParsingInput<T, O, F>
where F: Freeze, O: Freeze,

§

impl<T, O, F> !RefUnwindSafe for ParsingInput<T, O, F>

§

impl<T, O, F> Send for ParsingInput<T, O, F>
where F: Send, O: Send, T: Send,

§

impl<T, O, F> !Sync for ParsingInput<T, O, F>

§

impl<T, O, F> Unpin for ParsingInput<T, O, F>
where F: Unpin, O: Unpin,

§

impl<T, O, F> UnwindSafe for ParsingInput<T, O, F>
where F: UnwindSafe, O: UnwindSafe, T: UnwindSafe,

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<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, 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.