Trait Parse

Source
pub trait Parse<'a>: Sized {
    // Required method
    fn parse_from_tokens(
        tokens: impl Tokens<'a>,
        max_depth: usize,
    ) -> Result<Self, Vec<Error>>;

    // Provided methods
    fn parse(s: &'a str) -> Result<Self, Vec<Error>> { ... }
    fn parse_with_options(
        s: &'a str,
        options: ParseOptions,
    ) -> Result<Self, Vec<Error>> { ... }
}

Required Methods§

Source

fn parse_from_tokens( tokens: impl Tokens<'a>, max_depth: usize, ) -> Result<Self, Vec<Error>>

Provided Methods§

Source

fn parse(s: &'a str) -> Result<Self, Vec<Error>>

Source

fn parse_with_options( s: &'a str, options: ParseOptions, ) -> Result<Self, Vec<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§

Source§

impl<'a> Parse<'a> for ExecutableDocument<'a>

Source§

impl<'a, C: Context> Parse<'a> for DefinitionDocument<'a, C>

Source§

impl<'a, T: FromTokens<'a>> Parse<'a> for T