pub struct SingBoxBackendOptions { /* private fields */ }Expand description
Already-resolved host inputs for one sing-box backend.
The driver never resolves product paths: the host supplies the installed binary, the active profile document, the stable Core instance identity and the loopback Clash API coordinates that the profile declares.
Implementations§
Source§impl SingBoxBackendOptions
impl SingBoxBackendOptions
Sourcepub fn new(
binary_path: impl Into<PathBuf>,
config_path: impl Into<PathBuf>,
instance_id: CoreInstanceId,
controller_endpoint: impl Into<String>,
secret: Option<String>,
) -> Result<Self, PortError>
pub fn new( binary_path: impl Into<PathBuf>, config_path: impl Into<PathBuf>, instance_id: CoreInstanceId, controller_endpoint: impl Into<String>, secret: Option<String>, ) -> Result<Self, PortError>
Validates the host inputs with the default readiness bound.
Sourcepub fn with_readiness_timeout(
binary_path: impl Into<PathBuf>,
config_path: impl Into<PathBuf>,
instance_id: CoreInstanceId,
controller_endpoint: impl Into<String>,
secret: Option<String>,
readiness_timeout: Duration,
) -> Result<Self, PortError>
pub fn with_readiness_timeout( binary_path: impl Into<PathBuf>, config_path: impl Into<PathBuf>, instance_id: CoreInstanceId, controller_endpoint: impl Into<String>, secret: Option<String>, readiness_timeout: Duration, ) -> Result<Self, PortError>
Validates the host inputs together with an explicit readiness bound.
Sourcepub fn binary_path(&self) -> &PathBuf
pub fn binary_path(&self) -> &PathBuf
Returns the path of the sing-box binary the host may launch.
Sourcepub fn config_path(&self) -> &PathBuf
pub fn config_path(&self) -> &PathBuf
Returns the path of the configuration file the core reads.
Sourcepub fn instance_id(&self) -> &CoreInstanceId
pub fn instance_id(&self) -> &CoreInstanceId
Returns the configured instance identity of the core.
Sourcepub fn controller_address(&self) -> SocketAddr
pub fn controller_address(&self) -> SocketAddr
Returns the socket address the controller binds to.
Sourcepub fn controller_endpoint(&self) -> String
pub fn controller_endpoint(&self) -> String
Returns the explicit HTTP loopback endpoint of the controller.
Sourcepub const fn readiness_timeout(&self) -> Duration
pub const fn readiness_timeout(&self) -> Duration
Bound the host applies while waiting for Clash API readiness after it explicitly starts the Core. Bundle creation never waits.