Trait Parse

Source
pub trait Parse<C: Context>: Debug + Sized {
    type Parsed: Into<Self>;
    type Error: Error;

    // Required method
    fn parse(self, ctx: &mut C) -> Result<Self::Parsed, Self::Error>;
}
Available on crate feature parse only.
Expand description

A parse trait.

Required Associated Types§

Source

type Parsed: Into<Self>

The parsed type.

After parsing this type must be able to convert back. Note that it is not required for the conversion to be lossless as long as the semantics don’t change.

Source

type Error: Error

The error type for this parser.

Required Methods§

Source

fn parse(self, ctx: &mut C) -> Result<Self::Parsed, Self::Error>

Parse and return a parsed type or error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§