Skip to main content

UsernameValidator

Trait UsernameValidator 

Source
pub trait UsernameValidator: Send + Sync {
    // Required method
    fn validate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        value: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

Awaited application validation of a username or display username.

Required Methods§

Source

fn validate<'life0, 'life1, 'async_trait>( &'life0 self, value: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, Fut> UsernameValidator for F
where F: Fn(String) -> Fut + Send + Sync, Fut: Future<Output = Result<bool, AuthError>> + Send,