pub struct HealthEndpoint { /* private fields */ }Expand description
A wrapper to expose worker pool health via an HTTP endpoint.
This struct implements traits for common web frameworks to make integrating health checks into your application straightforward.
Implementations§
Source§impl HealthEndpoint
impl HealthEndpoint
Sourcepub fn new(check: impl HealthCheck + 'static) -> Self
pub fn new(check: impl HealthCheck + 'static) -> Self
Create a new health endpoint from a health-checkable component.
Sourcepub fn get_status_json(&self) -> String
pub fn get_status_json(&self) -> String
Get the current health status as a JSON-serializable string.
Sourcepub fn get_http_status_code(&self) -> u16
pub fn get_http_status_code(&self) -> u16
Get the HTTP status code corresponding to the current health.
Auto Trait Implementations§
impl !RefUnwindSafe for HealthEndpoint
impl !UnwindSafe for HealthEndpoint
impl Freeze for HealthEndpoint
impl Send for HealthEndpoint
impl Sync for HealthEndpoint
impl Unpin for HealthEndpoint
impl UnsafeUnpin for HealthEndpoint
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