Skip to main content

Supervisor

Struct Supervisor 

Source
pub struct Supervisor { /* private fields */ }
Expand description

Process-local orchestrator for Runtime-owned managed services.

The supervisor never starts, stops, or replaces its host process.

Implementations§

Source§

impl Supervisor

Source

pub fn diagnose(&self) -> SupervisorDiagnosis

Returns a deterministic diagnostic report without mutating services.

Source

pub fn snapshots(&self) -> Vec<ServiceSnapshot>

Returns current service snapshots in lexical order.

Source

pub fn events(&self) -> Vec<SupervisorEvent>

Returns retained lifecycle events without removing them.

Source

pub fn is_healthy(&self, timestamp_ms: u64) -> bool

Reports whether graph, watchdog, executor, and critical services are healthy.

Source§

impl Supervisor

Source

pub fn reconcile(&self, timestamp_ms: u64) -> SupervisorResult<()>

Reconciles health and schedules restart work without executing it inline.

Source

pub fn restart(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>

Schedules one restart while enforcing its temporal budget.

Source

pub fn stop(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>

Stops one enabled service without affecting the host process.

Source

pub fn evaluate_watchdog(&self, timestamp_ms: u64) -> WatchdogSnapshot

Independently evaluates watchdog progress and emits transition events.

Source

pub fn shutdown(&self, timestamp_ms: u64) -> SupervisorResult<()>

Stops the restart executor and all enabled services in reverse order.

Source§

impl Supervisor

Source

pub fn new() -> Self

Creates an empty supervisor with safe watchdog and executor defaults.

Source

pub fn with_watchdog_config(config: WatchdogConfig) -> SupervisorResult<Self>

Creates an empty supervisor with installation watchdog policy.

Source

pub fn with_event_capacity(event_capacity: usize) -> Self

Creates an empty supervisor with an explicit event bound.

Source

pub fn same_instance(&self, other: &Self) -> bool

Reports whether two handles reference the same supervisor instance.

Source

pub fn watchdog(&self) -> Arc<SupervisorWatchdog>

Returns the lock-independent watchdog shared with health consumers.

Source

pub fn register(&self, service: Arc<dyn ManagedService>) -> SupervisorResult<()>

Registers one unique service without starting it.

Source

pub fn register_or_replace_inactive( &self, service: Arc<dyn ManagedService>, ) -> SupervisorResult<()>

Registers a service or replaces an inactive deployment placeholder.

An enabled registration is never replaced because it may own resources.

Source

pub fn validate(&self) -> SupervisorResult<Vec<String>>

Validates policies and returns dependency-first service order.

Source

pub fn start_all(&self) -> SupervisorResult<()>

Starts all enabled services in dependency order.

Source

pub fn start(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>

Starts one enabled service after checking all dependencies.

Trait Implementations§

Source§

impl Clone for Supervisor

Source§

fn clone(&self) -> Supervisor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Supervisor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.