pub struct AppState {
pub client: UpstreamClient,
pub metrics: Arc<Metrics>,
pub runtime: Arc<ArcSwap<Runtime>>,
pub cp: Option<Arc<CpClient>>,
pub quota: Arc<QuotaState>,
}Expand description
Shared, cheaply-cloned handle the router hands to every request. Only the hot-swappable
Runtime changes on reload; the client and metrics are stable.
Fields§
§client: UpstreamClient§metrics: Arc<Metrics>§runtime: Arc<ArcSwap<Runtime>>§cp: Option<Arc<CpClient>>Managed-mode control-plane client (Some only when [control_plane] is enabled). Used to
forward CSP reports; policy pull + usage reporting run as background tasks in main.
quota: Arc<QuotaState>Shared quota verdict, updated by the managed-mode quota poller and read by the
hard-stop gate below. Lives here (not on the hot-swappable Runtime) so a policy reload
never resets enforcement. Inert unless control_plane.enforce_quota is set.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more