pub trait UsernameLabelParser:
Default
+ Send
+ Sync
+ 'static {
type Error: Into<BoxError>;
// Required methods
fn parse_label(&mut self, label: &str) -> UsernameLabelState;
fn build(self, ext: &mut Extensions) -> Result<(), Self::Error>;
}Expand description
A parser which can parse labels from a username.
Default is to be implemented for every UsernameLabelParser,
as it is what is used to create the parser instances for one-time usage.
Required Associated Types§
Required Methods§
Sourcefn parse_label(&mut self, label: &str) -> UsernameLabelState
fn parse_label(&mut self, label: &str) -> UsernameLabelState
Interpret the label and return whether or not the label was recognised and valid.
UsernameLabelState::Ignored should be returned in case the label was not recognised or was not valid.
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.