Struct grafana_plugin_sdk::backend::CheckHealthResponse
source · #[non_exhaustive]pub struct CheckHealthResponse {
pub status: HealthStatus,
pub message: String,
pub json_details: Value,
}
Expand description
The response to a health check request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.status: HealthStatus
The status of the plugin.
message: String
A message associated with the health check.
json_details: Value
Any additional details to include with the response.
Implementations§
source§impl CheckHealthResponse
impl CheckHealthResponse
sourcepub fn new(status: HealthStatus, message: String, json_details: Value) -> Self
👎Deprecated since 1.3.0: use ok/error/unknown constructors instead
pub fn new(status: HealthStatus, message: String, json_details: Value) -> Self
Create a new CheckHealthResponse
.
sourcepub fn ok(message: String) -> Self
pub fn ok(message: String) -> Self
Create a CheckHealthResponse
with status HealthStatus::Ok
.
The JSON in json_details
will be set to null
; use CheckHealthResponse::with_json_details
to override it.
sourcepub fn error(message: String) -> Self
pub fn error(message: String) -> Self
Create a CheckHealthResponse
with status HealthStatus::Error
.
The JSON in json_details
will be set to null
; use CheckHealthResponse::with_json_details
to override it.
sourcepub fn unknown(message: String) -> Self
pub fn unknown(message: String) -> Self
Create a CheckHealthResponse
with status HealthStatus::Unknown
.
The JSON in json_details
will be set to null
; use CheckHealthResponse::with_json_details
to override it.
sourcepub fn with_json_details(self, json_details: Value) -> Self
pub fn with_json_details(self, json_details: Value) -> Self
Update self
with the given JSON details, returning a new CheckHealthResponse
.
Trait Implementations§
source§impl Debug for CheckHealthResponse
impl Debug for CheckHealthResponse
source§impl Default for CheckHealthResponse
impl Default for CheckHealthResponse
source§impl From<CheckHealthResponse> for CheckHealthResponse
impl From<CheckHealthResponse> for CheckHealthResponse
source§fn from(other: CheckHealthResponse) -> Self
fn from(other: CheckHealthResponse) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for CheckHealthResponse
impl Send for CheckHealthResponse
impl Sync for CheckHealthResponse
impl Unpin for CheckHealthResponse
impl UnwindSafe for CheckHealthResponse
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request