Trait rama::proxy::UsernameFormatter

pub trait UsernameFormatter<S>: Send + Sync + 'static {
    // Required method
    fn fmt_username(
        &self,
        ctx: &Context<S>,
        proxy: &Proxy,
        filter: &ProxyFilter,
        username: &str,
    ) -> Option<String>;
}
Expand description

Trait that is used to allow the formatting of a username, e.g. to allow proxy routers to have proxy config labels in the username.

Required Methods§

fn fmt_username( &self, ctx: &Context<S>, proxy: &Proxy, filter: &ProxyFilter, username: &str, ) -> Option<String>

format the username based on the root properties of the given proxy.

Implementations on Foreign Types§

§

impl<S> UsernameFormatter<S> for ()

§

fn fmt_username( &self, _ctx: &Context<S>, _proxy: &Proxy, _filter: &ProxyFilter, _username: &str, ) -> Option<String>

Implementors§

§

impl<F, S> UsernameFormatter<S> for F
where F: Fn(&Context<S>, &Proxy, &ProxyFilter, &str) -> Option<String> + Send + Sync + 'static,