Skip to main content

ParseTarget

Trait ParseTarget 

Source
pub(super) trait ParseTarget<'input, const VERSION: u8, const OWNED: bool> {
    type ItemWithLiteralLifetime;
    type ItemWithStaticLifetime;
    type Component: TryFrom<AstComponent, Error: Into<Error>>;
    type Output;

    // Required methods
    fn literal(value: &'input str) -> Self::ItemWithLiteralLifetime;
    fn component(
        component: Self::Component,
    ) -> Result<Self::ItemWithLiteralLifetime, Error>;
    fn optional(
        value: Vec<Self::ItemWithLiteralLifetime>,
        format: bool,
        span: Span,
    ) -> Result<Self::ItemWithLiteralLifetime, Error>;
    fn first(
        value: Vec<Vec<Self::ItemWithLiteralLifetime>>,
        span: Span,
    ) -> Result<Self::ItemWithLiteralLifetime, Error>;
    fn parse(s: &'input str) -> Result<Self::Output, Error>;
}

Required Associated Types§

Required Methods§

Source

fn literal(value: &'input str) -> Self::ItemWithLiteralLifetime

Source

fn component( component: Self::Component, ) -> Result<Self::ItemWithLiteralLifetime, Error>

Source

fn optional( value: Vec<Self::ItemWithLiteralLifetime>, format: bool, span: Span, ) -> Result<Self::ItemWithLiteralLifetime, Error>

Source

fn first( value: Vec<Vec<Self::ItemWithLiteralLifetime>>, span: Span, ) -> Result<Self::ItemWithLiteralLifetime, Error>

Source

fn parse(s: &'input str) -> Result<Self::Output, 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.

Implementations on Foreign Types§

Source§

impl<'input> ParseTarget<'input, 1, false> for ()

Source§

impl<'input> ParseTarget<'input, 1, true> for ()

Source§

impl<'input> ParseTarget<'input, 2, false> for ()

Source§

impl<'input> ParseTarget<'input, 2, true> for ()

Source§

impl<'input> ParseTarget<'input, 3, false> for ()

Source§

impl<'input> ParseTarget<'input, 3, true> for ()

Implementors§