pub struct General {
pub client: Client,
}Fields§
§client: ClientImplementations§
Source§impl General
impl General
Sourcepub async fn ping(&self) -> Result<&'static str>
pub async fn ping(&self) -> Result<&'static str>
Test connectivity
§Examples
use binance::{api::*, general::*, config::*};
let conf = Config::default().set_rest_api_endpoint(DATA_REST_ENDPOINT);
let general: General = Binance::new_with_env(&conf);
let pong = tokio_test::block_on(general.ping());
assert!(pong.is_ok(), "{:?}", pong);
assert_eq!(pong.unwrap(), "pong");Sourcepub async fn get_server_time(&self) -> Result<ServerTime>
pub async fn get_server_time(&self) -> Result<ServerTime>
Check server time
§Examples
use binance::{api::*, general::*, config::*};
let conf = Config::default().set_rest_api_endpoint(DATA_REST_ENDPOINT);
let general: General = Binance::new_with_env(&conf);
let server_time = tokio_test::block_on(general.get_server_time());
assert!(server_time.is_ok(), "{:?}", server_time);Sourcepub async fn exchange_info(&self) -> Result<ExchangeInformation>
pub async fn exchange_info(&self) -> Result<ExchangeInformation>
Obtain exchange information (rate limits, symbol metadata etc)
§Examples
use binance::{api::*, general::*, config::*};
let conf = Config::default().set_rest_api_endpoint(DATA_REST_ENDPOINT);
let general: General = Binance::new_with_env(&conf);
let exchange_info = tokio_test::block_on(general.exchange_info());
assert!(exchange_info.is_ok(), "{:?}", exchange_info);Trait Implementations§
Source§impl Binance for General
impl Binance for General
fn new_with_config( api_key: Option<String>, secret_key: Option<String>, config: &Config, ) -> General
fn new(api_key: Option<String>, secret_key: Option<String>) -> Self
Source§fn new_with_env(config: &Config) -> Self
fn new_with_env(config: &Config) -> Self
Create a binance API using environment variables for credentials
BINANCE_API_KEY=$YOUR_API_KEY
BINANCE_API_SECRET_KEY=$YOUR_SECRET_KEY
Auto Trait Implementations§
impl Freeze for General
impl !RefUnwindSafe for General
impl Send for General
impl Sync for General
impl Unpin for General
impl !UnwindSafe for General
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