1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use crateAsync;
/// A trait for converting various result types into the `Async<T>` representation.
///
/// This trait provides a unified way to convert different result types (direct values,
/// `Result<T, E>`, and `Option<T>`) into the `Async<T>` type used throughout the EaseRx framework.
/// It simplifies error handling by automatically converting various error types into
/// the appropriate `Async` variant.
///
/// Implementors of this trait can be used directly with the execution methods of `StateStore`.
/// Implementation for direct values of type `T`.
///
/// This implementation wraps the value in `Async::Success`.
/// Implementation for `Result<T, E>` where `E` can be converted to a string.
///
/// This implementation converts:
/// - `Ok(value)` to `Async::Success { value }`
/// - `Err(error)` to `Async::Fail` with the error message
/// Implementation for `Option<T>`.
///
/// This implementation converts:
/// - `Some(value)` to `Async::Success { value }`
/// - `None` to `Async::Fail` with a None error