InptStep

Struct InptStep 

Source
pub struct InptStep<'s, T> {
    pub data: InptResult<'s, T>,
    pub rest: &'s str,
}
Expand description

The output of a single parsing step.

Fields§

§data: InptResult<'s, T>

The parsed type if successful, or the cause of the error if not.

§rest: &'s str

The remaining input to parse.

Implementations§

Source§

impl<'s, T> InptStep<'s, T>

Source

pub fn map<V>(self, f: impl FnOnce(T) -> V) -> InptStep<'s, V>

Apply the given function to the successfully parsed type if any, keeping the error and remaining input the same.

Source

pub fn try_map<V, E>(self, f: impl FnOnce(T) -> Result<V, E>) -> InptStep<'s, V>
where E: StdError,

Apply the given function to the successfully parsed type if any, producing a converted error if the function fails.

Trait Implementations§

Source§

impl<'s, T: Debug> Debug for InptStep<'s, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s, T> Freeze for InptStep<'s, T>
where T: Freeze,

§

impl<'s, T> !RefUnwindSafe for InptStep<'s, T>

§

impl<'s, T> !Send for InptStep<'s, T>

§

impl<'s, T> !Sync for InptStep<'s, T>

§

impl<'s, T> Unpin for InptStep<'s, T>
where T: Unpin,

§

impl<'s, T> !UnwindSafe for InptStep<'s, T>

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.