Skip to main content

AuthInstance

Trait AuthInstance 

Source
pub trait AuthInstance:
    Clone
    + Send
    + Sync
    + 'static {
    type Db: Adapter;
    type UserFields: Fields;
    type Plugins: PluginSet;

    // Required methods
    fn config(&self) -> &CoreConfig;
    fn api(&self) -> Api<'_, Self::Db>;
    fn handle(
        &self,
        request: Request<Bytes>,
    ) -> impl Future<Output = Response> + Send;
    fn session_with_cookies(
        &self,
        headers: &HeaderMap,
    ) -> impl Future<Output = (Result<Option<SessionData<Self::UserFields, Self::Plugins>>, AuthError>, Vec<HeaderValue>)> + Send;
}
Expand description

What integrations and plugin extension traits need from an auth instance, without naming its type parameters.

Required Associated Types§

Required Methods§

Source

fn config(&self) -> &CoreConfig

Source

fn api(&self) -> Api<'_, Self::Db>

Source

fn handle( &self, request: Request<Bytes>, ) -> impl Future<Output = Response> + Send

Source

fn session_with_cookies( &self, headers: &HeaderMap, ) -> impl Future<Output = (Result<Option<SessionData<Self::UserFields, Self::Plugins>>, AuthError>, Vec<HeaderValue>)> + Send

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<D: Adapter, U: Fields, P: PluginSet> AuthInstance for Auth<D, U, P>