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§
Sourcetype BorrowedOutput<'input>
type BorrowedOutput<'input>
The output type of the borrowed parser. This type avoids allocating where possible.
Sourcetype OwnedOutput
type OwnedOutput
The output type of the owned parser. This type may allocate but is valid for 'static.
Required Methods§
Sourcefn parse_borrowed(
s: &str,
) -> Result<Self::BorrowedOutput<'_>, InvalidFormatDescription>
fn parse_borrowed( s: &str, ) -> Result<Self::BorrowedOutput<'_>, InvalidFormatDescription>
Parse a format description into a type that avoids allocating where possible.
Sourcefn parse_owned(s: &str) -> Result<Self::OwnedOutput, InvalidFormatDescription>
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.