pub struct ServiceSupervisor { /* private fields */ }Implementations§
Source§impl ServiceSupervisor
impl ServiceSupervisor
pub fn start(config_path: &str) -> Result<Self, RuntimeError>
Sourcepub fn start_from_config(
rt_config: RuntimeConfig,
config_path: Option<String>,
) -> Result<Self, RuntimeError>
pub fn start_from_config( rt_config: RuntimeConfig, config_path: Option<String>, ) -> Result<Self, RuntimeError>
Start from an already-validated [RuntimeConfig] without reading a file.
When config_path is provided (file-backed startup), SIGHUP reload
is enabled. When None (in-memory/compatibility startup), SIGHUP
reload is disabled because there is no stable user-authored config
file to reload from.
pub fn start_from_config_with_options( rt_config: RuntimeConfig, config_path: Option<String>, compatibility_options: CompatibilityOptions, ) -> Result<Self, RuntimeError>
pub fn state(&self) -> &Arc<RuntimeState> ⓘ
pub fn shutdown_token(&self) -> CancellationToken
Sourcepub fn with_tls_client_config(self, config: Arc<ClientConfig>) -> Self
pub fn with_tls_client_config(self, config: Arc<ClientConfig>) -> Self
Override the TLS client config used for upstream connections (e.g., Trojan). Intended for test-only use (e.g., insecure TLS for self-signed certs).
Sourcepub fn reload_config(&mut self) -> ReloadResult
pub fn reload_config(&mut self) -> ReloadResult
Attempt to reload configuration. Encapsulates the full reload transaction:
- Load and compile new config
- Classify unsupported changes (reject if listener topology changed)
- Build new snapshot with previous snapshot for Arc reuse
- Atomically swap routing and snapshot
- Update stored rt_config for subsequent reloads
pub fn run(&mut self) -> Result<(), RuntimeError>
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceSupervisor
impl !UnwindSafe for ServiceSupervisor
impl Freeze for ServiceSupervisor
impl Send for ServiceSupervisor
impl Sync for ServiceSupervisor
impl Unpin for ServiceSupervisor
impl UnsafeUnpin for ServiceSupervisor
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