recoverable_spawn/thread/
type.rs

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