pub struct Stream { /* private fields */ }Expand description
WebSocket stream client
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn configure(self, config: StreamConfig) -> Self
pub fn configure(self, config: StreamConfig) -> Self
Configure stream options
Sourcepub fn on_reconnect<F>(self, f: F) -> Self
pub fn on_reconnect<F>(self, f: F) -> Self
Set reconnect callback
Sourcepub fn on_state_change<F>(self, f: F) -> Self
pub fn on_state_change<F>(self, f: F) -> Self
Set state change callback
Sourcepub fn state(&self) -> ConnectionState
pub fn state(&self) -> ConnectionState
Get current connection state
Sourcepub fn reconnect_attempts(&self) -> u32
pub fn reconnect_attempts(&self) -> u32
Get reconnect attempts
Sourcepub fn trades<F>(&mut self, coins: &[&str], callback: F) -> Subscription
pub fn trades<F>(&mut self, coins: &[&str], callback: F) -> Subscription
Subscribe to trades
Sourcepub fn orders<F>(
&mut self,
coins: &[&str],
callback: F,
users: Option<&[&str]>,
) -> Subscription
pub fn orders<F>( &mut self, coins: &[&str], callback: F, users: Option<&[&str]>, ) -> Subscription
Subscribe to orders
Sourcepub fn book_updates<F>(&mut self, coins: &[&str], callback: F) -> Subscription
pub fn book_updates<F>(&mut self, coins: &[&str], callback: F) -> Subscription
Subscribe to book updates
Sourcepub fn twap<F>(&mut self, coins: &[&str], callback: F) -> Subscription
pub fn twap<F>(&mut self, coins: &[&str], callback: F) -> Subscription
Subscribe to TWAP updates
Sourcepub fn events<F>(&mut self, callback: F) -> Subscription
pub fn events<F>(&mut self, callback: F) -> Subscription
Subscribe to events
Sourcepub fn l2_book<F>(&mut self, coin: &str, callback: F) -> Subscription
pub fn l2_book<F>(&mut self, coin: &str, callback: F) -> Subscription
Subscribe to L2 order book
Sourcepub fn all_mids<F>(&mut self, callback: F) -> Subscription
pub fn all_mids<F>(&mut self, callback: F) -> Subscription
Subscribe to all mid prices
Sourcepub fn candle<F>(
&mut self,
coin: &str,
interval: &str,
callback: F,
) -> Subscription
pub fn candle<F>( &mut self, coin: &str, interval: &str, callback: F, ) -> Subscription
Subscribe to candles
Sourcepub fn open_orders<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn open_orders<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to user open orders
Sourcepub fn order_updates<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn order_updates<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to order updates
Sourcepub fn user_events<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn user_events<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to user events
Sourcepub fn user_fills<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn user_fills<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to user fills
Sourcepub fn user_fundings<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn user_fundings<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to user fundings
Sourcepub fn user_non_funding_ledger<F>(
&mut self,
user: &str,
callback: F,
) -> Subscription
pub fn user_non_funding_ledger<F>( &mut self, user: &str, callback: F, ) -> Subscription
Subscribe to user non-funding ledger updates
Sourcepub fn clearinghouse_state<F>(
&mut self,
user: &str,
callback: F,
) -> Subscription
pub fn clearinghouse_state<F>( &mut self, user: &str, callback: F, ) -> Subscription
Subscribe to clearinghouse state updates
Sourcepub fn bbo<F>(&mut self, coin: &str, callback: F) -> Subscription
pub fn bbo<F>(&mut self, coin: &str, callback: F) -> Subscription
Subscribe to best bid/offer
Sourcepub fn active_asset_ctx<F>(&mut self, coin: &str, callback: F) -> Subscription
pub fn active_asset_ctx<F>(&mut self, coin: &str, callback: F) -> Subscription
Subscribe to active asset context
Sourcepub fn active_asset_data<F>(
&mut self,
user: &str,
coin: &str,
callback: F,
) -> Subscription
pub fn active_asset_data<F>( &mut self, user: &str, coin: &str, callback: F, ) -> Subscription
Subscribe to active asset data for a user
Sourcepub fn twap_states<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn twap_states<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to TWAP states
Sourcepub fn user_twap_slice_fills<F>(
&mut self,
user: &str,
callback: F,
) -> Subscription
pub fn user_twap_slice_fills<F>( &mut self, user: &str, callback: F, ) -> Subscription
Subscribe to user TWAP slice fills
Sourcepub fn user_twap_history<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn user_twap_history<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to user TWAP history
Sourcepub fn notification<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn notification<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to notifications
Sourcepub fn web_data_3<F>(&mut self, user: &str, callback: F) -> Subscription
pub fn web_data_3<F>(&mut self, user: &str, callback: F) -> Subscription
Subscribe to web data 3 (aggregate user info)
Sourcepub fn writer_actions<F>(&mut self, callback: F) -> Subscription
pub fn writer_actions<F>(&mut self, callback: F) -> Subscription
Subscribe to writer actions (spot token transfers)
Sourcepub fn unsubscribe(&mut self, subscription: &Subscription)
pub fn unsubscribe(&mut self, subscription: &Subscription)
Unsubscribe from a channel
Auto Trait Implementations§
impl Freeze for Stream
impl !RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl !UnwindSafe for Stream
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request