-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Futures API support? #3
Comments
Sure, I'm not currently using futures but it shouldn't be hard to add. |
Here : #4 |
Thank you. But, I am getting runtime panic for this code use binance::api::*;
use binance::futures::general::*;
use futures::executor::block_on;
async fn get_all_symbols() {
let general: FuturesGeneral = Binance::new(None, None);
match general.exchange_info().await {
Ok(answer) => println!("Exchange information: {:?}", answer),
Err(e) => println!("Error: {:?}", e),
}
}
fn main() {
block_on(get_all_symbols());
}
|
I solved that by adding use binance::api::*;
use binance::futures::general::*;
use futures::executor::block_on;
+use tokio;
async fn get_all_symbols() {
let general: FuturesGeneral = Binance::new(None, None);
match general.exchange_info().await {
Ok(answer) => println!("Exchange information: {:?}", answer),
Err(e) => println!("Error: {:?}", e),
}
}
+#[tokio::main]
+async fn async_main() {
+
+ block_on(get_all_symbols());
+
+}
fn main() {
- block_on(get_all_symbols());
+ async_main();
} |
Didn't see that everything started requiring tokio, I updated the examples accordingly. |
See implementation in https://github.com/wisespace-io/binance-rs/tree/master/src/futures
The text was updated successfully, but these errors were encountered: