pub struct Client { /* private fields */ }Implementations§
source§impl Client
impl Client
pub fn new( api_key: Option<String>, secret_key: Option<String>, host: String, ) -> Self
pub async fn get<T: DeserializeOwned + Send + 'static>( &self, endpoint: API, request: Option<String>, ) -> Result<T, BybitError>
sourcepub async fn get_signed<T: DeserializeOwned + Send + 'static>(
&self,
endpoint: API,
recv_window: u128,
request: Option<String>,
) -> Result<T, BybitError>
pub async fn get_signed<T: DeserializeOwned + Send + 'static>( &self, endpoint: API, recv_window: u128, request: Option<String>, ) -> Result<T, BybitError>
Makes a signed HTTP GET request to the specified endpoint.
pub async fn post<T: DeserializeOwned + Send + 'static>( &self, endpoint: API, request: Option<String>, ) -> Result<T, BybitError>
sourcepub async fn post_signed<T: DeserializeOwned + Send + 'static>(
&self,
endpoint: API,
recv_window: u128,
raw_request_body: Option<String>,
) -> Result<T, BybitError>
pub async fn post_signed<T: DeserializeOwned + Send + 'static>( &self, endpoint: API, recv_window: u128, raw_request_body: Option<String>, ) -> Result<T, BybitError>
Makes a signed HTTP POST request to the specified endpoint
pub async fn wss_connect( &self, endpoint: WebsocketAPI, request_body: Option<String>, private: bool, alive_dur: Option<u64>, ) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>, BybitError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)