Skip to main content

AuthProvider

Trait AuthProvider 

Source
pub trait AuthProvider:
    Clone
    + Send
    + Sync
    + 'static {
    type Error: Into<CoolError> + Send;

    // Required method
    fn authenticate(
        &self,
        request: &RequestContext<'_>,
    ) -> impl Future<Output = Result<CoolContext, Self::Error>> + Send;
}

Required Associated Types§

Required Methods§

Source

fn authenticate( &self, request: &RequestContext<'_>, ) -> impl Future<Output = Result<CoolContext, Self::Error>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F, E> AuthProvider for F
where F: Clone + Send + Sync + 'static + for<'a> Fn(&'a HeaderMap) -> Result<CoolContext, E>, E: Into<CoolError> + Send,

Source§

type Error = E