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§
Sourcefn 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 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
Sourcefn needs_refresh(&self) -> bool
fn needs_refresh(&self) -> bool
Check if authentication needs to be refreshed
Provided Methods§
Sourcefn auth_timeout(&self) -> Duration
fn auth_timeout(&self) -> Duration
Get authentication timeout duration