binance_rs_plus/
userstream.rs1use crate::model::{Success, UserDataStream};
2use crate::client::Client;
3use crate::errors::Result;
4use crate::api::API;
5use crate::api::Spot;
6
7#[derive(Clone)]
8pub struct UserStream {
9 pub client: Client,
10 pub recv_window: u64, }
12
13impl UserStream {
14 pub async fn start(&self) -> Result<UserDataStream> {
16 self.client.post(API::Spot(Spot::UserDataStream)).await
17 }
18
19 pub async fn keep_alive(&self, listen_key: &str) -> Result<Success> {
21 self.client
22 .put(API::Spot(Spot::UserDataStream), listen_key)
23 .await
24 }
25
26 pub async fn close(&self, listen_key: &str) -> Result<Success> {
27 self.client
28 .delete(API::Spot(Spot::UserDataStream), listen_key)
29 .await
30 }
31}