recoverable_spawn/common/
type.rs

1use crate::*;
2
3/// Error type for spawn operations.
4pub type SpawnError = Box<dyn Any + Send>;
5
6/// Result type for asynchronous spawn operations.
7///
8/// # Returns
9///
10/// - `Result<(), JoinError>` - The spawn operation result.
11pub type AsyncSpawnResult = Result<(), JoinError>;
12
13/// Result type for synchronous spawn operations.
14///
15/// # Returns
16///
17/// - `Result<(), SpawnError>` - The spawn operation result.
18pub type SyncSpawnResult = Result<(), SpawnError>;
19
20/// Arc-wrapped asynchronous recoverable function.
21///
22/// # Type Parameters
23///
24/// - `O` - The output type.
25/// - `F` - The future type.
26pub type ArcAsyncRecoverableFunction<O, F> =
27    Arc<dyn AsyncRecoverableFunction<Output = O, Future = F>>;
28
29/// Arc-wrapped asynchronous error handler function.
30///
31/// # Type Parameters
32///
33/// - `O` - The future type.
34pub type ArcAsyncErrorHandlerFunction<O> = Arc<dyn AsyncErrorHandlerFunction<Future = O>>;