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
//! Health check configuration types.
//!
//! This module defines the types used to register custom health checks
//! with the [`HealthRegistry`], which is stored in application state and
//! queried on every `GET /__rapina/health` request.
use Future;
use Pin;
/// A boxed async function that returns `true` if the check passes, `false` otherwise.
///
/// This is the internal representation of a registered health check after type-erasure.
pub type HealthCheckFn = ;
/// Registry of named custom health checks stored in application state.
///
/// Each check is an async function that returns `true` when healthy.
/// The registry is populated via [`Rapina::add_health_check`](crate::app::Rapina::add_health_check)
/// and automatically placed in state when `.with_health_check(true)` is set.
///
/// On each request to `/__rapina/health`, all registered checks are called
/// and their results are included in the response under the `"checks"` key.