ServerManager

Trait ServerManager 

Source
pub trait ServerManager: Send + Sync {
    // Required methods
    async fn start(
        &self,
        network: Option<&str>,
        bind_ip: Option<String>,
    ) -> Result<()>;
    async fn stop(&self) -> Result<()>;
    fn url(&self) -> String;
    async fn is_running(&self) -> Result<bool>;
    async fn wait_until_ready(&self, timeout_secs: u64) -> Result<()>;
}
Expand description

Common trait for server management

Required Methods§

Source

async fn start( &self, network: Option<&str>, bind_ip: Option<String>, ) -> Result<()>

Start the server

§Errors

Returns an error if the server fails to start

Source

async fn stop(&self) -> Result<()>

Stop the server

§Errors

Returns an error if the server fails to stop

Source

fn url(&self) -> String

Get the URL of the server

Source

async fn is_running(&self) -> Result<bool>

Check if the server is running

§Errors

Returns an error if the check fails

Source

async fn wait_until_ready(&self, timeout_secs: u64) -> Result<()>

Wait for the server to be ready

§Errors

Returns an error if the server fails to become ready within the timeout

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§