pub trait RpcError:
Debug
+ Display
+ Into<Error>
+ Send
+ Sync
+ Unpin
+ 'static { }
Expand description
Requirements for an internal error
All errors have to be Send, Sync and ’static so they can be sent across threads. They also have to be Debug and Display so they can be logged.
We don’t require them to implement std::error::Error so we can use anyhow::Error as an error type.
Instead we require them to implement Into<anyhow::Error>
, which is available
both for any type that implements std::error::Error and anyhow itself.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.