pub struct HealthServer<H>where
H: HealthCheck + 'static,{ /* private fields */ }Expand description
HTTP health check server
Exposes /health and /ready endpoints for health monitoring.
Implementations§
Source§impl<H> HealthServer<H>where
H: HealthCheck + 'static,
impl<H> HealthServer<H>where
H: HealthCheck + 'static,
Sourcepub fn new(health: H) -> HealthServer<H>
pub fn new(health: H) -> HealthServer<H>
Create a new health server
Sourcepub fn addr(self, addr: impl Into<SocketAddr>) -> HealthServer<H>
pub fn addr(self, addr: impl Into<SocketAddr>) -> HealthServer<H>
Set the address to bind to
Sourcepub fn port(self, port: u16) -> HealthServer<H>
pub fn port(self, port: u16) -> HealthServer<H>
Set the port (binds to 0.0.0.0)
Sourcepub async fn serve(self) -> Result<(), HealthServerError>
pub async fn serve(self) -> Result<(), HealthServerError>
Start the health server
This will block until the server is shut down.
Sourcepub async fn serve_with_shutdown<F>(
self,
shutdown: F,
) -> Result<(), HealthServerError>
pub async fn serve_with_shutdown<F>( self, shutdown: F, ) -> Result<(), HealthServerError>
Start the health server with graceful shutdown
Auto Trait Implementations§
impl<H> Freeze for HealthServer<H>
impl<H> RefUnwindSafe for HealthServer<H>where
H: RefUnwindSafe,
impl<H> Send for HealthServer<H>
impl<H> Sync for HealthServer<H>
impl<H> Unpin for HealthServer<H>
impl<H> UnwindSafe for HealthServer<H>where
H: RefUnwindSafe,
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