quicburn-shared 0.1.0

A blazing fast QUIC implementation in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// crates/quicburn-shared/src/macros/state.rs

/// Generate a typed accessor method on `AppState` for a piece of
/// user-registered state.
///
/// ```rust,ignore
/// #[derive(Default)]
/// struct Counters { hits: AtomicUsize }
///
/// quicburn_server::app_state_ext!(counters -> Counters);
///
/// // setup:
/// app_state.register_state(Counters::default());
///
/// // in a handler:
/// let counters = state.counters(); // Arc<Counters>
/// ```