Trait AuthenticationMechanism

Source
pub trait AuthenticationMechanism: Send + Sync {
    // Required methods
    fn authenticate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ws_sink: &'life1 mut WebSocketSink,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn needs_refresh(&self) -> bool;
    fn refresh<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn auth_timeout(&self) -> Duration { ... }
}
Expand description

Authentication mechanism trait for different exchange authentication methods

Required Methods§

Source

fn authenticate<'life0, 'life1, 'async_trait>( &'life0 self, ws_sink: &'life1 mut WebSocketSink, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Perform authentication with the exchange

Source

fn needs_refresh(&self) -> bool

Check if authentication needs to be refreshed

Source

fn refresh<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Refresh authentication credentials

Provided Methods§

Source

fn auth_timeout(&self) -> Duration

Get authentication timeout duration

Implementors§