pub struct CoinbaseWebSocketHandler { /* private fields */ }Expand description
Coinbase WebSocket handler
Implementations§
Source§impl CoinbaseWebSocketHandler
impl CoinbaseWebSocketHandler
Sourcepub fn register_subscription(&self, key: String, info: SubscriptionInfo)
pub fn register_subscription(&self, key: String, info: SubscriptionInfo)
Register a subscription
Trait Implementations§
Source§impl Default for CoinbaseWebSocketHandler
impl Default for CoinbaseWebSocketHandler
Source§impl ExchangeHandler for CoinbaseWebSocketHandler
impl ExchangeHandler for CoinbaseWebSocketHandler
Source§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,
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
Source§fn authenticate<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<Option<Message>>> + Send + 'async_trait>>where
Self: '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: 'async_trait,
'life0: 'async_trait,
Handle authentication if required
Source§fn requires_auth(&self) -> bool
fn requires_auth(&self) -> bool
Check if the connection needs authentication
Source§fn get_heartbeat(&self) -> Option<Message>
fn get_heartbeat(&self) -> Option<Message>
Get heartbeat message if required
Source§fn heartbeat_interval(&self) -> Option<Duration>
fn heartbeat_interval(&self) -> Option<Duration>
Get heartbeat interval
Source§impl MessageHandler for CoinbaseWebSocketHandler
impl MessageHandler for CoinbaseWebSocketHandler
Source§fn on_message<'life0, 'async_trait>(
&'life0 mut self,
message: Message,
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_message<'life0, 'async_trait>(
&'life0 mut self,
message: Message,
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a received message
Source§fn on_connected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_connected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle connection established
Source§fn on_disconnected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_disconnected<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = WebSocketResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle connection closed
Source§fn on_error<'life0, 'async_trait>(
&'life0 mut self,
error: WebSocketError,
) -> Pin<Box<dyn Future<Output = Result<(), WebSocketError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_error<'life0, 'async_trait>(
&'life0 mut self,
error: WebSocketError,
) -> Pin<Box<dyn Future<Output = Result<(), WebSocketError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle errors
Source§fn set_sender(&mut self, _sender: UnboundedSender<Message>)
fn set_sender(&mut self, _sender: UnboundedSender<Message>)
Set the sender for outgoing messages (optional, default implementation does nothing)
Source§fn send_message(&self, _message: Message) -> Result<(), WebSocketError>
fn send_message(&self, _message: Message) -> Result<(), WebSocketError>
Send a message through the WebSocket (optional, default implementation returns error)
Auto Trait Implementations§
impl Freeze for CoinbaseWebSocketHandler
impl !RefUnwindSafe for CoinbaseWebSocketHandler
impl Send for CoinbaseWebSocketHandler
impl Sync for CoinbaseWebSocketHandler
impl Unpin for CoinbaseWebSocketHandler
impl !UnwindSafe for CoinbaseWebSocketHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more