Struct arithmetic_parser::grammars::WithMockedTypes

source ·
pub struct WithMockedTypes<T, Ty>(/* private fields */);
Expand description

Decorator for a grammar that mocks type parsing.

§Examples

See MockTypes for examples of usage.

Trait Implementations§

source§

impl<T: Debug, Ty: Debug> Debug for WithMockedTypes<T, Ty>

source§

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

Formats the value using the given formatter. Read more
source§

impl<T: ParseLiteral, Ty: MockTypes> Grammar for WithMockedTypes<T, Ty>

§

type Type<'a> = ()

Type of the type annotation used in the grammar. This type may be parametric by the input lifetime.
source§

fn parse_type(input: InputSpan<'_>) -> NomResult<'_, Self::Type<'_>>

Attempts to parse a type annotation. Read more
source§

impl<T: ParseLiteral, Ty: MockTypes> Parse for WithMockedTypes<T, Ty>

§

type Base = WithMockedTypes<T, Ty>

Base for the grammar providing the literal and type annotation parsers.
source§

const FEATURES: Features = _

Features supported by this grammar.
source§

fn parse_statements<'a, I>(input: I) -> Result<Block<'a, Self::Base>, Error>
where I: IntoInputSpan<'a>, Self: Sized,

Parses a list of statements.
source§

fn parse_streaming_statements<'a, I>( input: I, ) -> Result<Block<'a, Self::Base>, Error>
where I: IntoInputSpan<'a>, Self: Sized,

Parses a potentially incomplete list of statements.
source§

impl<T: ParseLiteral, Ty: MockTypes> ParseLiteral for WithMockedTypes<T, Ty>

§

type Lit = <T as ParseLiteral>::Lit

Type of the literal used in the grammar.
source§

fn parse_literal(input: InputSpan<'_>) -> NomResult<'_, Self::Lit>

Attempts to parse a literal. Read more

Auto Trait Implementations§

§

impl<T, Ty> Freeze for WithMockedTypes<T, Ty>

§

impl<T, Ty> RefUnwindSafe for WithMockedTypes<T, Ty>

§

impl<T, Ty> Send for WithMockedTypes<T, Ty>
where T: Send, Ty: Send,

§

impl<T, Ty> Sync for WithMockedTypes<T, Ty>
where T: Sync, Ty: Sync,

§

impl<T, Ty> Unpin for WithMockedTypes<T, Ty>
where T: Unpin, Ty: Unpin,

§

impl<T, Ty> UnwindSafe for WithMockedTypes<T, Ty>
where T: UnwindSafe, Ty: 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>,

§

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

§

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.