Trait rama::username::UsernameLabelParser

pub trait UsernameLabelParser:
    Default
    + Send
    + Sync
    + 'static {
    type Error: Into<Box<dyn Error + Sync + Send>>;

    // 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§

type Error: Into<Box<dyn Error + Sync + Send>>

Error which can occur during the building phase.

Required Methods§

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.

fn build(self, ext: &mut Extensions) -> Result<(), Self::Error>

Consume self and store/use any of the relevant info seen.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl UsernameLabelParser for ()

§

type Error = Infallible

§

fn parse_label(&mut self, _label: &str) -> UsernameLabelState

§

fn build( self, _ext: &mut Extensions, ) -> Result<(), <() as UsernameLabelParser>::Error>

§

impl<T1> UsernameLabelParser for (T1,)

§

type Error = OpaqueError

§

fn parse_label(&mut self, label: &str) -> UsernameLabelState

§

fn build( self, ext: &mut Extensions, ) -> Result<(), <(T1,) as UsernameLabelParser>::Error>

§

impl<T1, T2> UsernameLabelParser for (T1, T2)

§

type Error = OpaqueError

§

fn parse_label(&mut self, label: &str) -> UsernameLabelState

§

fn build( self, ext: &mut Extensions, ) -> Result<(), <(T1, T2) as UsernameLabelParser>::Error>

§

impl<T1, T2, T3> UsernameLabelParser for (T1, T2, T3)

§

type Error = OpaqueError

§

fn parse_label(&mut self, label: &str) -> UsernameLabelState

§

fn build( self, ext: &mut Extensions, ) -> Result<(), <(T1, T2, T3) as UsernameLabelParser>::Error>

§

impl<T1, T2, T3, T4> UsernameLabelParser for (T1, T2, T3, T4)

§

impl<T1, T2, T3, T4, T5> UsernameLabelParser for (T1, T2, T3, T4, T5)

§

impl<T1, T2, T3, T4, T5, T6> UsernameLabelParser for (T1, T2, T3, T4, T5, T6)

§

impl<T1, T2, T3, T4, T5, T6, T7> UsernameLabelParser for (T1, T2, T3, T4, T5, T6, T7)

§

impl<T1, T2, T3, T4, T5, T6, T7, T8> UsernameLabelParser for (T1, T2, T3, T4, T5, T6, T7, T8)

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> UsernameLabelParser for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> UsernameLabelParser for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> UsernameLabelParser for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> UsernameLabelParser for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Implementors§

§

impl UsernameLabelParser for DnsResolveModeUsernameParser

§

impl UsernameLabelParser for ProxyFilterUsernameParser

§

impl UsernameLabelParser for UsernameOpaqueLabelParser

§

impl<T1> UsernameLabelParser for ExclusiveUsernameParsers<(T1,)>

§

impl<T1, T2> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2)>

§

impl<T1, T2, T3> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3)>

§

impl<T1, T2, T3, T4> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4)>

§

impl<T1, T2, T3, T4, T5> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5)>

§

impl<T1, T2, T3, T4, T5, T6> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6)>

§

impl<T1, T2, T3, T4, T5, T6, T7> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6, T7)>

§

impl<T1, T2, T3, T4, T5, T6, T7, T8> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6, T7, T8)>

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>

§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> UsernameLabelParser for ExclusiveUsernameParsers<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>