pub struct HealthCheck {
pub status: HealthStatus,
pub component: String,
pub message: Option<String>,
pub response_time_ms: Option<i64>,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
Detailed health check result for a component.
Fields§
§status: HealthStatusOverall health status
component: StringComponent name
message: Option<String>Detailed status message
response_time_ms: Option<i64>Response time in milliseconds (if applicable)
metadata: Option<HashMap<String, Value>>Additional metadata
Implementations§
Source§impl HealthCheck
impl HealthCheck
Sourcepub fn degraded(
component: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn degraded( component: impl Into<String>, message: impl Into<String>, ) -> Self
Create a degraded check result.
Sourcepub fn unhealthy(
component: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn unhealthy( component: impl Into<String>, message: impl Into<String>, ) -> Self
Create an unhealthy check result.
Sourcepub fn with_response_time(self, ms: i64) -> Self
pub fn with_response_time(self, ms: i64) -> Self
Set the response time.
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata.
Trait Implementations§
Source§impl Clone for HealthCheck
impl Clone for HealthCheck
Source§fn clone(&self) -> HealthCheck
fn clone(&self) -> HealthCheck
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for HealthCheck
impl ComposeSchema for HealthCheck
Source§impl Debug for HealthCheck
impl Debug for HealthCheck
Source§impl<'de> Deserialize<'de> for HealthCheck
impl<'de> Deserialize<'de> for HealthCheck
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HealthCheck
impl PartialEq for HealthCheck
Source§impl Serialize for HealthCheck
impl Serialize for HealthCheck
Source§impl ToSchema for HealthCheck
impl ToSchema for HealthCheck
impl StructuralPartialEq for HealthCheck
Auto Trait Implementations§
impl Freeze for HealthCheck
impl RefUnwindSafe for HealthCheck
impl Send for HealthCheck
impl Sync for HealthCheck
impl Unpin for HealthCheck
impl UnwindSafe for HealthCheck
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