Skip to main content

Authenticator

Trait Authenticator 

Source
pub trait Authenticator: Debug + Send {
    // Required methods
    fn start(
        &mut self,
        context: AuthContext<'_>,
    ) -> Result<Option<AuthProperties>, AuthError>;
    fn continue_auth(
        &mut self,
        context: AuthContext<'_>,
        incoming: Option<AuthProperties>,
    ) -> Result<AuthAction, AuthError>;
    fn success(
        &mut self,
        context: AuthContext<'_>,
        incoming: Option<AuthProperties>,
    ) -> Result<(), AuthError>;
    fn failure(&mut self, context: AuthContext<'_>, error: AuthError);
}
Expand description

MQTT 5 enhanced-authentication callback interface.

Required Methods§

Source

fn start( &mut self, context: AuthContext<'_>, ) -> Result<Option<AuthProperties>, AuthError>

Called when an enhanced-authentication exchange starts.

§Errors

Return an error to abort the exchange locally.

Source

fn continue_auth( &mut self, context: AuthContext<'_>, incoming: Option<AuthProperties>, ) -> Result<AuthAction, AuthError>

Called when the broker sends AUTH Continue.

§Errors

Return an error to abort the exchange locally.

Source

fn success( &mut self, context: AuthContext<'_>, incoming: Option<AuthProperties>, ) -> Result<(), AuthError>

Called when the broker sends AUTH Success.

§Errors

Return an error if the successful server response cannot be accepted by the authentication mechanism.

Source

fn failure(&mut self, context: AuthContext<'_>, error: AuthError)

Called when an active exchange fails or is aborted.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§