pub struct AppState {
pub tunnel: Tunnel,
pub secret: Option<String>,
pub config_path: String,
pub raw_config: Arc<RwLock<RawConfig>>,
pub log_tx: Sender<LogMessage>,
pub proxy_providers: Arc<DashMap<String, Arc<ProxyProvider>>>,
pub rule_providers: Arc<RwLock<HashMap<String, Arc<RuleProvider>>>>,
pub listeners: Vec<NamedListener>,
pub external_ui: Option<PathBuf>,
pub config_mutation_lock: Mutex<()>,
}Fields§
§tunnel: Tunnel§secret: Option<String>Optional Bearer token enforced by require_auth. None or empty disables auth.
config_path: String§raw_config: Arc<RwLock<RawConfig>>§log_tx: Sender<LogMessage>Fan-out channel for log events. Each WS client subscribes a Receiver.
proxy_providers: Arc<DashMap<String, Arc<ProxyProvider>>>Live proxy-provider registry — refreshed by background task and PUT endpoint.
rule_providers: Arc<RwLock<HashMap<String, Arc<RuleProvider>>>>§listeners: Vec<NamedListener>Snapshot of active named listeners (read-only, startup-time only in M1).
external_ui: Option<PathBuf>Validated directory for a third-party web UI. When Some, it is served
at /ui; when None, the built-in panel is served (issue #223).
config_mutation_lock: Mutex<()>Serialises put_configs and commit_raw_candidate so that the
“read-old-config → write-new-config → TUN reconcile” sequence is
executed atomically with respect to other config mutations. Without
this a concurrent PUT could stop_tun before a sibling’s
set_tun_handle has completed, leaving a running TUN device behind an
enable=false config.
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl !UnwindSafe 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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more