pub struct General {
pub client: Client,
}Fields
client: ClientImplementations
sourceimpl 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 general: General = Binance::new_with_env(&Config::default());
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 general: General = Binance::new_with_env(&Config::default());
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 general: General = Binance::new_with_env(&Config::default());
let excyahge_info = tokio_test::block_on(general.exchange_info());
assert!(excyahge_info.is_ok(), "{:?}", excyahge_info);Trait Implementations
sourceimpl 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
sourcefn 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=
BINANCE_API_SECRET_KEY= Read more
Auto Trait Implementations
impl !RefUnwindSafe for General
impl Send for General
impl Sync for General
impl Unpin for General
impl !UnwindSafe for General
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more