pub struct WsRequest { /* private fields */ }Expand description
Binance websocket request.
Implementations§
Source§impl WsRequest
impl WsRequest
Sourcepub fn subscribe_stream(name: Name) -> Self
pub fn subscribe_stream(name: Name) -> Self
Subscribe to a stream. No matter whether the stream is main or sub.
Sourcepub fn subscribe(stream: Name) -> Self
👎Deprecated: Use subscribe_stream instead
pub fn subscribe(stream: Name) -> Self
subscribe_stream insteadSubscribe to a sub stream.
Sourcepub fn sub_stream(stream: Name) -> Self
pub fn sub_stream(stream: Name) -> Self
Subscribe to a sub stream.
Sourcepub fn timeout(self, duration: Duration) -> Self
pub fn timeout(self, duration: Duration) -> Self
Set stream timeout. Default to the default_stream_timeout in protocol config.
Sourcepub fn main_stream(stream: Name) -> Self
pub fn main_stream(stream: Name) -> Self
Subscribe to a main stream topic.
Sourcepub fn dispatch_trades(trades: SubscribeTrades) -> Self
pub fn dispatch_trades(trades: SubscribeTrades) -> Self
Dispatch trades.
Sourcepub fn dispatch_bid_ask(bid_ask: SubscribeBidAsk) -> Self
pub fn dispatch_bid_ask(bid_ask: SubscribeBidAsk) -> Self
Dispatch bid ask.
Trait Implementations§
Source§impl Service<WsRequest> for BinanceWebsocketApi
impl Service<WsRequest> for BinanceWebsocketApi
Source§type Response = WsResponse
type Response = WsResponse
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<BinanceWebsocketApi as Service<WsRequest>>::Response, <BinanceWebsocketApi as Service<WsRequest>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<BinanceWebsocketApi as Service<WsRequest>>::Response, <BinanceWebsocketApi as Service<WsRequest>>::Error>> + Send>>
The future response value.
Source§impl Service<WsRequest> for WsClient
impl Service<WsRequest> for WsClient
Source§type Response = WsResponse
type Response = WsResponse
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<WsClient as Service<WsRequest>>::Response, <WsClient as Service<WsRequest>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<WsClient as Service<WsRequest>>::Response, <WsClient as Service<WsRequest>>::Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl Freeze for WsRequest
impl !RefUnwindSafe for WsRequest
impl Send for WsRequest
impl !Sync for WsRequest
impl Unpin for WsRequest
impl !UnwindSafe for WsRequest
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
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>
Converts
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>
Converts
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