wisespace-io / binance-rs

Rust Library for the Binance API
Other
669 stars 300 forks source link

binance::errors::Error cannot be shared between threads safely #207

Open dovahcrow opened 1 year ago

dovahcrow commented 1 year ago

When converting the Error in this library into anyhow::Error, got the error in the title:

(dyn StdError + std::marker::Send + 'static)` cannot be shared between threads safely
   = help: the trait `Sync` is not implemented for `(dyn StdError + std::marker::Send + 'static)`
   = note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<(dyn StdError + std::marker::Send + 'static)>`
   = note: required because it appears within the type `Box<(dyn StdError + std::marker::Send + 'static)>`
   = note: required because it appears within the type `std::option::Option<Box<(dyn StdError + std::marker::Send + 'static)>>`
   = note: required because it appears within the type `error_chain::State`
   = note: required because it appears within the type `binance::errors::Error`
   = note: required because of the requirements on the impl of `From<binance::errors::Error>` for `anyhow::Error`
   = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, binance::errors::Error>>` for `Result<(), anyhow::Error>`