pub struct DeriveWebSocketSubscriptionHandle { /* private fields */ }Expand description
Cloneable command handle for Derive public market data subscriptions.
Implementations§
Source§impl DeriveWebSocketSubscriptionHandle
impl DeriveWebSocketSubscriptionHandle
Sourcepub async fn subscribe_ticker(
&self,
instrument_name: &str,
interval: &str,
) -> Result<()>
pub async fn subscribe_ticker( &self, instrument_name: &str, interval: &str, ) -> Result<()>
Subscribes to ticker_slim.{instrument_name}.{interval}.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn unsubscribe_ticker(
&self,
instrument_name: &str,
interval: &str,
) -> Result<()>
pub async fn unsubscribe_ticker( &self, instrument_name: &str, interval: &str, ) -> Result<()>
Unsubscribes from ticker_slim.{instrument_name}.{interval}.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn subscribe_orderbook(
&self,
instrument_name: &str,
group: &str,
depth: &str,
) -> Result<()>
pub async fn subscribe_orderbook( &self, instrument_name: &str, group: &str, depth: &str, ) -> Result<()>
Subscribes to orderbook.{instrument_name}.{group}.{depth}.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn unsubscribe_orderbook(
&self,
instrument_name: &str,
group: &str,
depth: &str,
) -> Result<()>
pub async fn unsubscribe_orderbook( &self, instrument_name: &str, group: &str, depth: &str, ) -> Result<()>
Unsubscribes from orderbook.{instrument_name}.{group}.{depth}.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn subscribe_trades(
&self,
instrument_type: &str,
currency: &str,
) -> Result<()>
pub async fn subscribe_trades( &self, instrument_type: &str, currency: &str, ) -> Result<()>
Subscribes to trades.{instrument_type}.{currency}.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn unsubscribe_trades(
&self,
instrument_type: &str,
currency: &str,
) -> Result<()>
pub async fn unsubscribe_trades( &self, instrument_type: &str, currency: &str, ) -> Result<()>
Unsubscribes from trades.{instrument_type}.{currency}.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn subscribe_channels<C>(&self, channels: Vec<C>) -> Result<()>where
C: Into<DeriveWsChannel>,
pub async fn subscribe_channels<C>(&self, channels: Vec<C>) -> Result<()>where
C: Into<DeriveWsChannel>,
Subscribes to multiple channel topics in a single subscribe frame.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Sourcepub async fn unsubscribe_channels<C>(&self, channels: Vec<C>) -> Result<()>where
C: Into<DeriveWsChannel>,
pub async fn unsubscribe_channels<C>(&self, channels: Vec<C>) -> Result<()>where
C: Into<DeriveWsChannel>,
Unsubscribes from multiple channel topics in a single
unsubscribe frame.
§Errors
Returns an error if the venue raises a JSON-RPC error or the transport fails.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DeriveWebSocketSubscriptionHandle
impl !UnwindSafe for DeriveWebSocketSubscriptionHandle
impl Freeze for DeriveWebSocketSubscriptionHandle
impl Send for DeriveWebSocketSubscriptionHandle
impl Sync for DeriveWebSocketSubscriptionHandle
impl Unpin for DeriveWebSocketSubscriptionHandle
impl UnsafeUnpin for DeriveWebSocketSubscriptionHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more