pub trait Parse<'a, Input = &'a str>: Sized {
type Output;
type Error;
// Required method
fn parse(
&self,
input: Input,
) -> Result<(Self::Output, &'a str), Self::Error>;
// Provided method
fn parse_as_component(
&self,
input: Input,
) -> Result<Option<(Self::Output, &'a str)>, <Self::Error as IntoSkipOrFatal>::Fatal>
where Self::Error: IntoSkipOrFatal { ... }
}
Expand description
Parse a segment.
Required Associated Types§
Required Methods§
Provided Methods§
fn parse_as_component(
&self,
input: Input,
) -> Result<Option<(Self::Output, &'a str)>, <Self::Error as IntoSkipOrFatal>::Fatal>where
Self::Error: IntoSkipOrFatal,
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.