pub struct EggressService { /* private fields */ }Expand description
Pre-start service builder.
Created from a validated config. Call .start() (async) or
.start_blocking() to launch the proxy and obtain a handle.
Implementations§
Source§impl EggressService
impl EggressService
Sourcepub fn new(config: EggressConfig) -> Self
pub fn new(config: EggressConfig) -> Self
Create a new service from a validated config.
Sourcepub fn from_toml_str(input: &str) -> Result<Self, EggressError>
pub fn from_toml_str(input: &str) -> Result<Self, EggressError>
Convenience: parse TOML and create a service.
Sourcepub fn from_toml_file(path: impl AsRef<Path>) -> Result<Self, EggressError>
pub fn from_toml_file(path: impl AsRef<Path>) -> Result<Self, EggressError>
Convenience: load file and create a service.
Sourcepub async fn start(self) -> Result<EggressHandle, EggressError>
pub async fn start(self) -> Result<EggressHandle, EggressError>
Start the service using a caller-provided Tokio runtime context.
The caller must be inside a Tokio runtime. The service binds listeners, starts health probes, and enters the event loop on a background task. Returns once readiness is achieved or startup fails.
Sourcepub fn start_blocking(self) -> Result<EggressHandle, EggressError>
pub fn start_blocking(self) -> Result<EggressHandle, EggressError>
Start the service with a dedicated runtime thread (blocking).
This spawns a background thread that creates a Tokio runtime and runs the proxy. Blocks until readiness is achieved or startup fails. Returns a handle that owns the runtime thread.
Sourcepub fn start_blocking_with_compatibility_options(
self,
compatibility_options: CompatibilityOptions,
) -> Result<EggressHandle, EggressError>
pub fn start_blocking_with_compatibility_options( self, compatibility_options: CompatibilityOptions, ) -> Result<EggressHandle, EggressError>
Start a compatibility service from the validated in-memory config.
This variant is used by the Python pproxy entry point so compatibility
options such as --auth, --sys, -d, and -v reach the runtime
without going through a temporary config file or the native defaults.