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
//! The per-delivery context's compile-time field keys without the `macros` feature: a
//! broker-supplied context type and the zero-sized `Field` key that reads one of its fields. No
//! attribute is involved on either path - a broker crate ships the key, and a handler reads
//! through it with `ctx.context(Offset)` whether the handler was generated or written by hand.
//! Here the key stands alone so the mechanism compiles on its own.
//!
//! ```text
//! cargo run --example manual_context_field --no-default-features
//! ```
// --8<-- [start:field]
use Field;
// A broker crate ships its per-delivery context and the keys that read its fields; an application
// reads a field by key from a handler taking `&mut Context<'_, Delivery>`.
;
// --8<-- [end:field]