rust-webx-core 0.2.1

rust-webx core traits: IRequest, IRequestHandler, IMiddleware, IHttpContext, IMediator, and more
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Application layer trait: IHost.

use crate::error::Result;

/// The web host that binds to an address and starts serving HTTP requests.
///
/// Analogous to ASP.NET Core's IWebHost.
#[async_trait::async_trait]
pub trait IHost: Send + Sync {
    async fn run(&self, addr: &str) -> Result<()>;
    async fn stop(&self) -> Result<()>;
}