pub struct GeneralClient { /* private fields */ }Expand description
Client for dealing with general exchange information
Implementations§
Source§impl GeneralClient
impl GeneralClient
Sourcepub fn connect<U: Into<String>>(url: U) -> Result<Self>
pub fn connect<U: Into<String>>(url: U) -> Result<Self>
Creates new client instance
§Example
use tokio_binance::{GeneralClient, BINANCE_US_URL};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = GeneralClient::connect(BINANCE_US_URL)?;
Ok(())
}Sourcepub fn ping(&self) -> ParamBuilder<'_, '_, PingParams>
pub fn ping(&self) -> ParamBuilder<'_, '_, PingParams>
Test connectivity to the Rest API.
§Example
use serde_json::Value;
let response = client
.ping()
.json::<Value>()
.await?;Sourcepub fn get_server_time(&self) -> ParamBuilder<'_, '_, TimeParams>
pub fn get_server_time(&self) -> ParamBuilder<'_, '_, TimeParams>
Test connectivity to the Rest API and get the current server time.
§Example
use serde_json::Value;
let response = client
.get_server_time()
.json::<Value>()
.await?;Sourcepub fn get_exchange_info(&self) -> ParamBuilder<'_, '_, ExchangeInfoParams>
pub fn get_exchange_info(&self) -> ParamBuilder<'_, '_, ExchangeInfoParams>
Current exchange trading rules and symbol information.
§Example
use serde_json::Value;
let response = client
.get_exchange_info()
.json::<Value>()
.await?;Trait Implementations§
Source§impl Clone for GeneralClient
impl Clone for GeneralClient
Source§fn clone(&self) -> GeneralClient
fn clone(&self) -> GeneralClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeneralClient
impl !RefUnwindSafe for GeneralClient
impl Send for GeneralClient
impl Sync for GeneralClient
impl Unpin for GeneralClient
impl !UnwindSafe for GeneralClient
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