pub struct AxumServer { /* private fields */ }Expand description
Axum-based server implementation
Implementations§
Source§impl AxumServer
impl AxumServer
Trait Implementations§
Source§impl HttpServer for AxumServer
impl HttpServer for AxumServer
Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ServerConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ServerConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start the server
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the server gracefully
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if server is running
Source§fn address(&self) -> Option<SocketAddr>
fn address(&self) -> Option<SocketAddr>
Get server address
Source§fn register_handler(
&mut self,
_path: &str,
_method: HttpMethod,
_handler: Box<dyn RequestHandler>,
)
fn register_handler( &mut self, _path: &str, _method: HttpMethod, _handler: Box<dyn RequestHandler>, )
Register a request handler
Source§fn register_middleware(&mut self, _middleware: Box<dyn Middleware>)
fn register_middleware(&mut self, _middleware: Box<dyn Middleware>)
Register middleware
Source§fn get_metrics(&self) -> ServerMetrics
fn get_metrics(&self) -> ServerMetrics
Get server metrics
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
Auto Trait Implementations§
impl Freeze for AxumServer
impl !RefUnwindSafe for AxumServer
impl Send for AxumServer
impl Sync for AxumServer
impl Unpin for AxumServer
impl UnsafeUnpin for AxumServer
impl !UnwindSafe for AxumServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more