pub struct AuthHandlerMap { /* private fields */ }Expand description
Implementation of AuthHandler that maintains a map of AuthMethodHandler implementations
for specific methods, invoking on_challenge, on_verification, on_info, and
on_error for a specific handler based on an associated id.
Implementations§
Source§impl AuthHandlerMap
 
impl AuthHandlerMap
Sourcepub fn active_id(&self) -> &str
 
pub fn active_id(&self) -> &str
Returns the id of the active AuthMethodHandler.
Sourcepub fn set_active_id(&mut self, id: impl Into<String>)
 
pub fn set_active_id(&mut self, id: impl Into<String>)
Sets the active AuthMethodHandler by its id.
Sourcepub fn insert_method_handler<T: AuthMethodHandler + 'static>(
    &mut self,
    id: &'static str,
    handler: T,
) -> Option<Box<dyn AuthMethodHandler>>
 
pub fn insert_method_handler<T: AuthMethodHandler + 'static>( &mut self, id: &'static str, handler: T, ) -> Option<Box<dyn AuthMethodHandler>>
Inserts the specified handler into the map, associating it with id for determining the
method that would trigger this handler.
Sourcepub fn remove_method_handler(
    &mut self,
    id: &'static str,
) -> Option<Box<dyn AuthMethodHandler>>
 
pub fn remove_method_handler( &mut self, id: &'static str, ) -> Option<Box<dyn AuthMethodHandler>>
Removes a handler with the associated id.
Sourcepub fn get_mut_active_method_handler_or_error(
    &mut self,
) -> Result<&mut (dyn AuthMethodHandler + 'static)>
 
pub fn get_mut_active_method_handler_or_error( &mut self, ) -> Result<&mut (dyn AuthMethodHandler + 'static)>
Retrieves a mutable reference to the active AuthMethodHandler with the specified id,
returning an error if no handler for the active id is found.
Sourcepub fn get_mut_active_method_handler(
    &mut self,
) -> Option<&mut (dyn AuthMethodHandler + 'static)>
 
pub fn get_mut_active_method_handler( &mut self, ) -> Option<&mut (dyn AuthMethodHandler + 'static)>
Retrieves a mutable reference to the active AuthMethodHandler with the specified id.
Sourcepub fn get_mut_method_handler(
    &mut self,
    id: &str,
) -> Option<&mut (dyn AuthMethodHandler + 'static)>
 
pub fn get_mut_method_handler( &mut self, id: &str, ) -> Option<&mut (dyn AuthMethodHandler + 'static)>
Retrieves a mutable reference to the AuthMethodHandler with the specified id.
Source§impl AuthHandlerMap
 
impl AuthHandlerMap
Sourcepub fn with_static_key<K>(self, key: K) -> Self
 
pub fn with_static_key<K>(self, key: K) -> Self
Consumes the map, returning a new map that supports the static_key method.