CustomParser

Struct CustomParser 

Source
pub struct CustomParser<'f, I, O> { /* private fields */ }
Expand description

A parser that uses a custom function.

Implementations§

Source§

impl<'f, I, O> CustomParser<'f, I, O>

Source

pub fn new(closure: &'f dyn Fn(&[I]) -> ParseResult<O>) -> Self

Trait Implementations§

Source§

impl<'f, I, O> Parser for CustomParser<'f, I, O>

Source§

type Input = I

Source§

type Output = O

Source§

fn parse(&self, data: &[Self::Input]) -> ParseResult<Self::Output>

Parse data, and return a ParseResult.

Auto Trait Implementations§

§

impl<'f, I, O> Freeze for CustomParser<'f, I, O>

§

impl<'f, I, O> !RefUnwindSafe for CustomParser<'f, I, O>

§

impl<'f, I, O> !Send for CustomParser<'f, I, O>

§

impl<'f, I, O> !Sync for CustomParser<'f, I, O>

§

impl<'f, I, O> Unpin for CustomParser<'f, I, O>

§

impl<'f, I, O> !UnwindSafe for CustomParser<'f, I, O>

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.