Trait Runtime

Source
pub trait Runtime: RuntimeDef {
    const MODE: RuntimeMode = RuntimeMode::Server;

    // Required methods
    fn deploy<'a>(&mut self, ctx: &mut Context<Self>) -> OutputResponse<'a>;
    fn start<'a>(&mut self, ctx: &mut Context<Self>) -> OutputResponse<'a>;
    fn run_command<'a>(
        &mut self,
        command: RunProcess,
        mode: RuntimeMode,
        ctx: &mut Context<Self>,
    ) -> ProcessIdResponse<'a>;

    // Provided methods
    fn stop<'a>(&mut self, _ctx: &mut Context<Self>) -> EmptyResponse<'a> { ... }
    fn kill_command<'a>(
        &mut self,
        _kill: KillProcess,
        _ctx: &mut Context<Self>,
    ) -> EmptyResponse<'a> { ... }
    fn offer<'a>(&mut self, _ctx: &mut Context<Self>) -> OutputResponse<'a> { ... }
    fn test<'a>(&mut self, _ctx: &mut Context<Self>) -> EmptyResponse<'a> { ... }
    fn join_network<'a>(
        &mut self,
        _network: CreateNetwork,
        _ctx: &mut Context<Self>,
    ) -> EndpointResponse<'a> { ... }
}
Expand description

Command handling interface for runtimes

Provided Associated Constants§

Source

const MODE: RuntimeMode = RuntimeMode::Server

Required Methods§

Source

fn deploy<'a>(&mut self, ctx: &mut Context<Self>) -> OutputResponse<'a>

Deploy and configure the runtime

Source

fn start<'a>(&mut self, ctx: &mut Context<Self>) -> OutputResponse<'a>

Start the runtime

Source

fn run_command<'a>( &mut self, command: RunProcess, mode: RuntimeMode, ctx: &mut Context<Self>, ) -> ProcessIdResponse<'a>

Start a runtime command

Provided Methods§

Source

fn stop<'a>(&mut self, _ctx: &mut Context<Self>) -> EmptyResponse<'a>

Stop the runtime

Source

fn kill_command<'a>( &mut self, _kill: KillProcess, _ctx: &mut Context<Self>, ) -> EmptyResponse<'a>

Stop runtime command execution

Source

fn offer<'a>(&mut self, _ctx: &mut Context<Self>) -> OutputResponse<'a>

Output a market Offer template stub

Source

fn test<'a>(&mut self, _ctx: &mut Context<Self>) -> EmptyResponse<'a>

Perform a self-test

Source

fn join_network<'a>( &mut self, _network: CreateNetwork, _ctx: &mut Context<Self>, ) -> EndpointResponse<'a>

Join a VPN network

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§