use crate::client::*;
use crate::errors::*;
use crate::rest_model::*;
static USER_DATA_STREAM: &str = "/fapi/v1/listenKey";
#[derive(Clone)]
pub struct UserStream {
pub client: Client,
pub recv_window: u64,
}
impl UserStream {
pub async fn start(&self) -> Result<UserDataStream> { self.client.post(USER_DATA_STREAM, None).await }
pub async fn keep_alive(&self, listen_key: &str) -> Result<Success> {
self.client.put(USER_DATA_STREAM, listen_key, None).await
}
pub async fn close(&self, listen_key: &str) -> Result<Success> {
self.client.delete(USER_DATA_STREAM, listen_key, None).await
}
}