Skip to main content

UsernameFormatter

Trait UsernameFormatter 

pub trait UsernameFormatter:
    Send
    + Sync
    + 'static {
    // Required method
    fn fmt_username(
        &self,
        proxy: &Proxy,
        filter: &ProxyFilter,
        username: &str,
        extensions: &Extensions,
    ) -> Option<String>;
}
Available on crate feature proxy only.
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, proxy: &Proxy, filter: &ProxyFilter, username: &str, extensions: &Extensions, ) -> Option<String>

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl UsernameFormatter for ()

§

fn fmt_username( &self, _proxy: &Proxy, _filter: &ProxyFilter, _username: &str, _extensions: &Extensions, ) -> Option<String>

Implementors§

§

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