pub trait ExchangeHandler: MessageHandler {
// Required methods
fn exchange(&self) -> Exchange;
fn get_subscriptions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Vec<Message>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn authenticate<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Option<Message>>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn requires_auth(&self) -> bool { ... }
fn get_heartbeat(&self) -> Option<Message> { ... }
fn heartbeat_interval(&self) -> Option<Duration> { ... }
}Expand description
Exchange-specific handler trait
Required Methods§
Sourcefn get_subscriptions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_subscriptions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get subscription messages
Provided Methods§
Sourcefn authenticate<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Option<Message>>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn authenticate<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Option<Message>>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Handle authentication if required
Sourcefn requires_auth(&self) -> bool
fn requires_auth(&self) -> bool
Check if the connection needs authentication
Sourcefn get_heartbeat(&self) -> Option<Message>
fn get_heartbeat(&self) -> Option<Message>
Get heartbeat message if required
Sourcefn heartbeat_interval(&self) -> Option<Duration>
fn heartbeat_interval(&self) -> Option<Duration>
Get heartbeat interval