pub struct DeribitWebSocketClient { /* private fields */ }Expand description
WebSocket client for Deribit
Implementations§
Source§impl DeribitWebSocketClient
impl DeribitWebSocketClient
Sourcepub fn new(config: DeribitConfig) -> Self
pub fn new(config: DeribitConfig) -> Self
Create a new WebSocket client
Sourcepub async fn send_message(&mut self, message: Value) -> DeribitResult<()>
pub async fn send_message(&mut self, message: Value) -> DeribitResult<()>
Send a message to the WebSocket
Sourcepub async fn receive_message(&mut self) -> DeribitResult<Option<Value>>
pub async fn receive_message(&mut self) -> DeribitResult<Option<Value>>
Receive a message from the WebSocket
Trait Implementations§
Source§impl DeribitClient for DeribitWebSocketClient
impl DeribitClient for DeribitWebSocketClient
type Error = DeribitError
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to Deribit
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from Deribit
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if connected
Auto Trait Implementations§
impl !Freeze for DeribitWebSocketClient
impl !RefUnwindSafe for DeribitWebSocketClient
impl Send for DeribitWebSocketClient
impl Sync for DeribitWebSocketClient
impl Unpin for DeribitWebSocketClient
impl !UnwindSafe for DeribitWebSocketClient
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