Runtime

Struct Runtime 

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

Main runtime for supervising and running nodes

Implementations§

Source§

impl Runtime

Source

pub fn builder() -> RuntimeBuilder

Create a new runtime builder

Source

pub async fn run_node( &mut self, name: &str, node: Box<dyn NodeRunner>, ) -> Result<()>

Run a single node until completion or shutdown

Source

pub async fn run_nodes(&mut self, nodes: Vec<Box<dyn NodeRunner>>) -> Result<()>

Run multiple nodes until all complete or shutdown

Source

pub async fn run_with_launcher(&mut self) -> Result<()>

Run with launcher service for dynamic node management

Source

pub async fn run_with_lifecycle(&mut self) -> Result<()>

Run with lifecycle management

This starts the runtime with lifecycle management enabled. The lifecycle manager will handle mode transitions and start/stop nodes accordingly.

The runtime will:

  1. Start nodes for the default mode
  2. Wait for shutdown signal
  3. Gracefully shut down all nodes

Mode transitions should be triggered externally via the lifecycle manager’s change_mode() method.

Source

pub fn health_checker(&self) -> &Arc<HealthChecker>

Get the health checker

Source

pub fn supervisor(&self) -> &Arc<Supervisor>

Get the supervisor

Source

pub fn launcher(&self) -> Option<&Arc<Launcher>>

Get the launcher (if enabled)

Source

pub fn lifecycle(&self) -> Option<&LifecycleManager>

Get the lifecycle manager (if enabled)

Source

pub fn lifecycle_mut(&mut self) -> Option<&mut LifecycleManager>

Get mutable lifecycle manager (if enabled)

Source

pub fn shutdown(&self) -> &ShutdownHandle

Get the shutdown handle

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more