sena/
lib.rs

1#![doc = include_str!("README.md")]
2
3/// Specifies type of an error,
4/// same as calling [`type_eq`] with expression and type `Result<_, $tp>`
5#[macro_export]
6macro_rules! err_eq {
7    ($e:expr, $tp:ty $(,)?) => {
8        $crate::type_eq!($e, Result<_, $tp>)
9    };
10}
11
12macro_rules! with_rt {
13    ($($stmt:item)*) => {
14        $(
15            #[cfg(feature = "tokio")]
16            $stmt
17        )*
18    }
19}
20
21/// Specifies type of the expression
22#[macro_export]
23macro_rules! type_eq {
24    ($e:expr, $tp:ty $(,)?) => {
25        ::core::convert::identity::<$tp>($e)
26    };
27}
28
29/// # Primitives for CSP-like communication
30pub mod csp;
31
32/// # Handling
33///
34/// All things related to composable handling: [`handling::handler::Handler`] definition and default recipes,
35/// like [`handling::pipe::Pipe`], [`handling::seq::Seq`] and so on.
36///
37/// To start, refer to [`handling::handler`] and specifially to [`handling::handler::Handler`].
38pub mod handling;
39
40/// # Errors which can be recovered
41pub mod recoverable;
42
43/// # Request with dependencies
44pub mod dependent;
45
46/// # Utilities for handling
47pub mod utils;