Skip to main content

ReadinessResponseBuilder

Struct ReadinessResponseBuilder 

Source
pub struct ReadinessResponseBuilder<V, S> { /* private fields */ }
Expand description

Typestate builder for ReadinessResponse.

Type parameters track whether required fields have been set:

  • VString once .version() is called, () otherwise
  • SString once .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>

Source

pub fn version( self, version: impl Into<String>, ) -> ReadinessResponseBuilder<String, S>

Set the semantic version of the service, e.g. "1.0.0".

Source§

impl<V> ReadinessResponseBuilder<V, ()>

Source

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>

Source

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>

Source

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>
where V: Freeze, S: Freeze,

§

impl<V, S> RefUnwindSafe for ReadinessResponseBuilder<V, S>

§

impl<V, S> Send for ReadinessResponseBuilder<V, S>
where V: Send, S: Send,

§

impl<V, S> Sync for ReadinessResponseBuilder<V, S>
where V: Sync, S: Sync,

§

impl<V, S> Unpin for ReadinessResponseBuilder<V, S>
where V: Unpin, S: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.