Struct tokio_binance::UserDataClient [−][src]
Client for dealing with the user data stream.
Implementations
impl UserDataClient
[src]
pub fn connect<A, U>(api_key: A, url: U) -> Result<Self> where
A: Into<String>,
U: Into<String>,
[src]
A: Into<String>,
U: Into<String>,
Creates new client instance
Example
use tokio_binance::{UserDataClient, BINANCE_US_URL}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = UserDataClient::connect("<api-key>", BINANCE_US_URL)?; Ok(()) }
pub fn start_stream(&self) -> ParamBuilder<'_, '_, StartStreamParams>
[src]
Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent.
Example
use serde_json::Value; let response = client .start_stream() .json::<Value>() .await?;
pub fn keep_alive<'a>(
&self,
listen_key: &'a str
) -> ParamBuilder<'a, '_, KeepAliveStreamParams>
[src]
&self,
listen_key: &'a str
) -> ParamBuilder<'a, '_, KeepAliveStreamParams>
Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.
Example
use serde_json::Value; let response = client .keep_alive("<listen-key>") .json::<Value>() .await?;
pub fn close_stream<'a>(
&self,
listen_key: &'a str
) -> ParamBuilder<'a, '_, CloseStreamParams>
[src]
&self,
listen_key: &'a str
) -> ParamBuilder<'a, '_, CloseStreamParams>
Close out a user data stream.
Example
use serde_json::Value; let response = client .close_stream("<listen-key>") .json::<Value>() .await?;
Trait Implementations
impl Clone for UserDataClient
[src]
fn clone(&self) -> UserDataClient
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for UserDataClient
[src]
impl Send for UserDataClient
[src]
impl Sync for UserDataClient
[src]
impl Unpin for UserDataClient
[src]
impl !UnwindSafe for UserDataClient
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,