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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Host feature flags for configuring runtime capabilities.
//!
//! Use these flags to enable host-supported functionality such as buffering
//! request/response bodies or accessing trailers. Combine multiple flags with
//! bitwise OR and pass the result to `admin::enable`.
use BitOr;
/// Enables buffering of the entire request body before your handler is invoked.
///
/// When enabled, the host reads the full request body into memory and then makes it
/// available to the guest. This allows multiple reads and supports request body
/// inspection or mutation workflows that need complete payload access.
///
/// Trade-offs:
/// - Increased memory usage proportional to request size
/// - Potential latency from buffering large payloads
///
/// Use this flag only when your plugin must read or modify the request body.
pub const BufferRequest: Feature = Feature;
/// Enables buffering of the entire response body before it is sent.
///
/// When enabled, the host collects the full response body so the guest can read and
/// modify it during response handling. This is required for plugins that rewrite,
/// filter, or analyze full response payloads.
///
/// Trade-offs:
/// - Increased memory usage proportional to response size
/// - Potential latency from buffering large payloads
///
/// Use this flag only when your plugin needs full response body access.
pub const BufferResponse: Feature = Feature;
/// Enables HTTP trailer support for chunked transfer encoding.
///
/// When enabled, the guest can access and modify trailer headers that arrive after
/// the body. Trailers are typically used to convey metadata computed during streaming,
/// such as checksums or signatures.
///
/// Notes:
/// - Not all hosts or upstream servers support trailers
/// - Trailers are only applicable to chunked or streaming responses
pub const Trailers: Feature = Feature;
/// Bitflag wrapper used to configure host capabilities.
///
/// Combine flags with `|` and pass the result to `admin::enable`.
;