pub trait Endpoint<Request>where
    Request: WebRequest,{
    type Error;

    // Required methods
    fn registrar(&self) -> Option<&(dyn Registrar + Sync)>;
    fn authorizer_mut(&mut self) -> Option<&mut (dyn Authorizer + Send)>;
    fn issuer_mut(&mut self) -> Option<&mut (dyn Issuer + Send)>;
    fn owner_solicitor(
        &mut self
    ) -> Option<&mut (dyn OwnerSolicitor<Request> + Send)>;
    fn scopes(&mut self) -> Option<&mut dyn Scopes<Request>>;
    fn response(
        &mut self,
        request: &mut Request,
        kind: Template<'_>
    ) -> Result<Request::Response, Self::Error>;
    fn error(&mut self, err: OAuthError) -> Self::Error;
    fn web_error(&mut self, err: Request::Error) -> Self::Error;

    // Provided method
    fn extension(&mut self) -> Option<&mut (dyn Extension + Send)> { ... }
}

Required Associated Types§

source

type Error

The error typed used as the error representation of each flow.

Required Methods§

source

fn registrar(&self) -> Option<&(dyn Registrar + Sync)>

A registrar if this endpoint can access one.

Returning None will implicate failing any flow that requires a registrar but does not have any effect on flows that do not require one.

source

fn authorizer_mut(&mut self) -> Option<&mut (dyn Authorizer + Send)>

An authorizer if this endpoint can access one.

Returning None will implicate failing any flow that requires an authorizer but does not have any effect on flows that do not require one.

source

fn issuer_mut(&mut self) -> Option<&mut (dyn Issuer + Send)>

An issuer if this endpoint can access one.

Returning None will implicate failing any flow that requires an issuer but does not have any effect on flows that do not require one.

source

fn owner_solicitor( &mut self ) -> Option<&mut (dyn OwnerSolicitor<Request> + Send)>

Return the system that checks owner consent.

Returning None will implicated failing the authorization code flow but does have any effect on other flows.

source

fn scopes(&mut self) -> Option<&mut dyn Scopes<Request>>

Determine the required scopes for a request.

The client must fulfill any one scope, so returning an empty slice will always deny the request.

source

fn response( &mut self, request: &mut Request, kind: Template<'_> ) -> Result<Request::Response, Self::Error>

Generate a prototype response.

The endpoint can rely on this being called at most once for each flow, if it wants to preallocate the response or return a handle on an existing prototype.

source

fn error(&mut self, err: OAuthError) -> Self::Error

Wrap an error.

source

fn web_error(&mut self, err: Request::Error) -> Self::Error

Wrap an error in the request/response types.

Provided Methods§

source

fn extension(&mut self) -> Option<&mut (dyn Extension + Send)>

Get the central extension instance this endpoint.

Returning None is the default implementation and acts as simply providing any extensions.

Implementations on Foreign Types§

source§

impl<Request, Inner, Ext> Endpoint<Request> for Extended<Inner, Ext>where Request: WebRequest, Inner: Endpoint<Request>, Ext: Extension + Send,

§

type Error = <Inner as Endpoint<Request>>::Error

source§

fn registrar(&self) -> Option<&(dyn Registrar + Sync)>

source§

fn authorizer_mut(&mut self) -> Option<&mut (dyn Authorizer + Send)>

source§

fn issuer_mut(&mut self) -> Option<&mut (dyn Issuer + Send)>

source§

fn owner_solicitor( &mut self ) -> Option<&mut (dyn OwnerSolicitor<Request> + Send)>

source§

fn scopes(&mut self) -> Option<&mut dyn Scopes<Request>>

source§

fn response( &mut self, request: &mut Request, kind: Template<'_> ) -> Result<Request::Response, Self::Error>

source§

fn error(&mut self, err: OAuthError) -> Self::Error

source§

fn web_error(&mut self, err: Request::Error) -> Self::Error

source§

fn extension(&mut self) -> Option<&mut (dyn Extension + Send)>

Implementors§