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
58
59
60
use Route;
use crateLayerSpec;
/// A documented tower middleware that can inject its spec into wrapped operations.
///
/// Implement this trait to make a tower layer visible in OpenAPI/apidocs output.
/// Return `Some(spec)` from [`layer_spec`] to describe what the middleware reads
/// from or adds to requests. One middleware produces at most one [`LayerSpec`];
/// multiple extraction points (e.g. reading both `Authorization` and `X-Api-Key`)
/// are represented as multiple [`ArgPart`]s inside that single spec.
///
/// Use [`RawLayer`] / [`layer_from`] to wrap any third-party tower layer that
/// needs no documentation.
///
/// [`layer_spec`]: Middleware::layer_spec
/// [`ArgPart`]: crate::callables::ArgPart
/// Zero-cost adapter that wraps any tower layer as an undocumented [`Middleware`].
///
/// Use [`layer_from`] to construct one.
;
/// Wraps a plain tower layer as an undocumented [`Middleware`].
///
/// No spec is injected into operations; use this for third-party layers
/// (e.g. `tower_http::compression::CompressionLayer`) that have no
/// uxar-level documentation.