pub struct Runtime { /* private fields */ }Expand description
Runtime orchestrator for managing nodes
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub async fn new(robot_id: &str) -> RuntimeResult<Self>
pub async fn new(robot_id: &str) -> RuntimeResult<Self>
Create a new runtime instance
Sourcepub async fn start_node(&mut self, config: NodeConfig) -> RuntimeResult<()>
pub async fn start_node(&mut self, config: NodeConfig) -> RuntimeResult<()>
Start a node
Sourcepub async fn stop_node(&mut self, node_id: &str) -> RuntimeResult<()>
pub async fn stop_node(&mut self, node_id: &str) -> RuntimeResult<()>
Stop a node
Sourcepub async fn restart_node(&mut self, node_id: &str) -> RuntimeResult<()>
pub async fn restart_node(&mut self, node_id: &str) -> RuntimeResult<()>
Restart a node
Sourcepub async fn node_state(&self, node_id: &str) -> Option<NodeState>
pub async fn node_state(&self, node_id: &str) -> Option<NodeState>
Get node state
Sourcepub async fn list_nodes(&self) -> Vec<String>
pub async fn list_nodes(&self) -> Vec<String>
List all nodes
Sourcepub async fn run(&mut self) -> RuntimeResult<()>
pub async fn run(&mut self) -> RuntimeResult<()>
Run the runtime (blocks until shutdown)
Sourcepub async fn shutdown(&mut self) -> RuntimeResult<()>
pub async fn shutdown(&mut self) -> RuntimeResult<()>
Shutdown the runtime gracefully
Auto Trait Implementations§
impl Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more