Skip to main content

VersionedParser

Trait VersionedParser 

Source
pub trait VersionedParser {
    type BorrowedOutput<'input>;
    type OwnedOutput;

    // Required methods
    fn parse_borrowed(
        s: &str,
    ) -> Result<Self::BorrowedOutput<'_>, InvalidFormatDescription>;
    fn parse_owned(
        s: &str,
    ) -> Result<Self::OwnedOutput, InvalidFormatDescription>;
}
Available on (crate features formatting or parsing) and crate feature alloc only.
Expand description

A trait for parsing format descriptions, with different output types depending on the version.

Required Associated Types§

Source

type BorrowedOutput<'input>

The output type of the borrowed parser. This type avoids allocating where possible.

Source

type OwnedOutput

The output type of the owned parser. This type may allocate but is valid for 'static.

Required Methods§

Source

fn parse_borrowed( s: &str, ) -> Result<Self::BorrowedOutput<'_>, InvalidFormatDescription>

Parse a format description into a type that avoids allocating where possible.

Source

fn parse_owned(s: &str) -> Result<Self::OwnedOutput, InvalidFormatDescription>

Parse a format description into an owned type, which may allocate but is valid for 'static.

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§