antithesis_intake/http/
state.rs1use std::sync::{Arc, OnceLock};
4
5use crate::capture;
6
7#[derive(Clone, Debug)]
9pub struct AppState {
10 pub(crate) recorder: capture::State,
11 pub(crate) target: capture::Target,
12 pub(crate) established_host: Arc<OnceLock<String>>,
15}
16
17impl AppState {
18 #[must_use]
20 pub fn agent(recorder: &capture::State) -> Self {
21 Self {
22 recorder: recorder.clone(),
23 target: capture::Target::Agent,
24 established_host: Arc::default(),
25 }
26 }
27
28 #[must_use]
30 pub fn adp(recorder: &capture::State) -> Self {
31 Self {
32 recorder: recorder.clone(),
33 target: capture::Target::Adp,
34 established_host: Arc::default(),
35 }
36 }
37}