rust_webx_core/app.rs
1//! Application layer trait: IHost.
2
3use crate::error::Result;
4
5/// The web host that binds to an address and starts serving HTTP requests.
6///
7/// Analogous to ASP.NET Core's IWebHost.
8#[async_trait::async_trait]
9pub trait IHost: Send + Sync {
10 async fn run(&self, addr: &str) -> Result<()>;
11 async fn stop(&self) -> Result<()>;
12}