wisespace-io / binance-rs

Rust Library for the Binance API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dovahcrow opened this issue · comments

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>`