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
//! Upstream adapter for async functions.
use Future;
use Upstream;
/// Wrapper that adapts an async function to the [`Upstream`] trait.
///
/// This allows any async function or closure to be used as the upstream
/// data source in the hitbox caching FSM.
///
/// # Example
///
/// ```ignore
/// use hitbox_fn::FnUpstream;
///
/// async fn fetch_data(id: u64) -> Data {
/// // fetch from database
/// }
///
/// let upstream = FnUpstream::new(fetch_data);
/// ```