pub struct ReadinessResponseBuilder<V, S> { /* private fields */ }Expand description
Typestate builder for ReadinessResponse.
Type parameters track whether required fields have been set:
V—Stringonce.version()is called,()otherwiseS—Stringonce.service_id()is called,()otherwise
ReadinessResponseBuilder::build is only available when both are set.
Requires the std feature (uses HashMap internally).
Implementations§
Source§impl<S> ReadinessResponseBuilder<(), S>
impl<S> ReadinessResponseBuilder<(), S>
Source§impl<V> ReadinessResponseBuilder<V, ()>
impl<V> ReadinessResponseBuilder<V, ()>
Sourcepub fn service_id(
self,
service_id: impl Into<String>,
) -> ReadinessResponseBuilder<V, String>
pub fn service_id( self, service_id: impl Into<String>, ) -> ReadinessResponseBuilder<V, String>
Set the unique service instance identifier, e.g. "my-service".
Source§impl<V, S> ReadinessResponseBuilder<V, S>
impl<V, S> ReadinessResponseBuilder<V, S>
Sourcepub fn add_check(self, key: impl Into<String>, check: HealthCheck) -> Self
pub fn add_check(self, key: impl Into<String>, check: HealthCheck) -> Self
Add a single component check under the given key.
Key format: "<component>:<measurement>", e.g. "postgres:connection".
Multiple checks under the same key are appended.
Source§impl ReadinessResponseBuilder<String, String>
impl ReadinessResponseBuilder<String, String>
Sourcepub fn build(self) -> ReadinessResponse
pub fn build(self) -> ReadinessResponse
Build the ReadinessResponse, computing the aggregate status from all checks.
Only available once both version and service_id have been set.
Auto Trait Implementations§
impl<V, S> Freeze for ReadinessResponseBuilder<V, S>
impl<V, S> RefUnwindSafe for ReadinessResponseBuilder<V, S>where
V: RefUnwindSafe,
S: RefUnwindSafe,
impl<V, S> Send for ReadinessResponseBuilder<V, S>
impl<V, S> Sync for ReadinessResponseBuilder<V, S>
impl<V, S> Unpin for ReadinessResponseBuilder<V, S>
impl<V, S> UnsafeUnpin for ReadinessResponseBuilder<V, S>where
V: UnsafeUnpin,
S: UnsafeUnpin,
impl<V, S> UnwindSafe for ReadinessResponseBuilder<V, S>where
V: UnwindSafe,
S: UnwindSafe,
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