Skip to main content

WebServer

Trait WebServer 

Source
pub trait WebServer {
    // Required methods
    fn start(&self) -> Pin<Box<dyn Future<Output = ()>>>;
    fn stop(&self) -> Pin<Box<dyn Future<Output = ()>>>;
}
Expand description

A trait for managing the lifecycle of a web server.

Implementors of this trait provide asynchronous methods for starting and stopping web server instances.

Required Methods§

Source

fn start(&self) -> Pin<Box<dyn Future<Output = ()>>>

Starts the web server.

This method initiates the web server, binding to configured addresses and beginning to accept incoming connections.

Source

fn stop(&self) -> Pin<Box<dyn Future<Output = ()>>>

Stops the web server.

This method gracefully shuts down the web server, closing active connections and releasing resources.

Implementors§