rings_core/error/mod.rs
1//! Error of rings_core
2
3/// A wrap `Result` contains custom errors.
4pub type Result<T> = std::result::Result<T, Error>;
5
6/// Application callback error retained as the source of a core error.
7///
8/// Wasm callbacks may retain thread-local error values.
9#[cfg(all(feature = "wasm", target_family = "wasm"))]
10pub type CallbackError = Box<dyn std::error::Error>;
11
12/// Application callback error retained as the source of a core error.
13///
14/// Since 0.18 native callbacks require `Send + Sync` because callback work is
15/// driven by Tokio tasks. Prefer this alias in [`crate::swarm::callback::SwarmCallback`]
16/// implementations instead of spelling the trait object directly.
17#[cfg(not(all(feature = "wasm", target_family = "wasm")))]
18pub type CallbackError = Box<dyn std::error::Error + Send + Sync>;
19
20mod kind;
21mod policy;
22#[cfg(all(feature = "wasm", target_family = "wasm"))]
23mod wasm;
24
25pub use kind::Error;