Skip to main content

DatabaseConnection

Trait DatabaseConnection 

Source
pub trait DatabaseConnection: Send + Sized {
    type Error: Error;

    // Required methods
    fn authenticate(
        &self,
        jwt: &str,
    ) -> impl Future<Output = Result<User, AuthenticationError<Self::Error>>> + Send + Sized;
    fn signin(
        &self,
        credentials: Credentials,
    ) -> impl Future<Output = Result<String, AuthenticationError<Self::Error>>> + Send + Sized;
}

Required Associated Types§

Required Methods§

Source

fn authenticate( &self, jwt: &str, ) -> impl Future<Output = Result<User, AuthenticationError<Self::Error>>> + Send + Sized

Source

fn signin( &self, credentials: Credentials, ) -> impl Future<Output = Result<String, AuthenticationError<Self::Error>>> + Send + Sized

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§