Function parse_username
pub fn parse_username<P>(
ext: &Extensions,
parser: P,
username_ref: impl AsRef<str>,
) -> Result<String, Box<dyn Error + Send + Sync>>where
P: UsernameLabelParser,
<P as UsernameLabelParser>::Error: Into<Box<dyn Error + Send + Sync>>,Expand description
Parse a username, extracting the username (first part)
and passing everything else to the UsernameLabelParser.
Strict mode: any UsernameLabelState::Ignored label is fatal, since
username labels are operator-composed configuration and an unknown label
most likely indicates a misconfiguration that should fail loudly. Use
parse_username_lossy when you want unknown labels to be silently skipped.