pub trait ManagedService: Send + Sync {
// Required methods
fn descriptor(&self) -> &ServiceDescriptor;
fn start(&self) -> SupervisorResult<()>;
fn stop(&self, timeout: Duration) -> SupervisorResult<()>;
fn health(&self) -> ServiceHealth;
// Provided method
fn runtime_state(&self) -> ServiceRuntimeState { ... }
}Expand description
Lifecycle boundary implemented by every supervised Runtime service.
Required Methods§
Sourcefn descriptor(&self) -> &ServiceDescriptor
fn descriptor(&self) -> &ServiceDescriptor
Returns immutable identity, dependencies, resource, and policy.
Sourcefn start(&self) -> SupervisorResult<()>
fn start(&self) -> SupervisorResult<()>
Starts the service and its bounded resources.
Sourcefn stop(&self, timeout: Duration) -> SupervisorResult<()>
fn stop(&self, timeout: Duration) -> SupervisorResult<()>
Requests cooperative shutdown inside timeout.
Sourcefn health(&self) -> ServiceHealth
fn health(&self) -> ServiceHealth
Returns current service health.
Provided Methods§
Sourcefn runtime_state(&self) -> ServiceRuntimeState
fn runtime_state(&self) -> ServiceRuntimeState
Returns the concrete service execution state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".