Skip to main content

ProtectedHealthCheck

Struct ProtectedHealthCheck 

Source
pub struct ProtectedHealthCheck { /* private fields */ }
Expand description

A validated protected health-check order: the cluster, its configuration with a trusted fingerprint on every header, and the held values.

Implementations§

Source§

impl ProtectedHealthCheck

Source

pub fn from_ingress( key: &FingerprintKey, order: &mut SetProtectedHealthCheck, ) -> Result<Self, ProtectedHealthCheckError>

An operator order: validate every name and value, then fingerprint each value under key. A fingerprint the client supplied is only accepted when it is the one key computes. Nothing is built unless all of it is valid; the carriers are emptied of the values that are accepted.

Source

pub fn from_trusted( order: &mut SetProtectedHealthCheck, ) -> Result<Self, ProtectedHealthCheckError>

An order the main process built: every header already carries the fingerprint it issued, which is trusted as it is.

Source

pub fn from_parts( cluster_id: String, config: HealthCheckConfig, headers: ProtectedHeaderSet, ) -> Result<Self, ProtectedHealthCheckError>

The order of a cluster from its parts: the main process’s own configuration, every header of which carries the fingerprint it issued, and the held values behind them. The set must satisfy the headers.

Source

pub fn cluster_id(&self) -> &str

Source

pub fn config(&self) -> &HealthCheckConfig

The configuration, headers carrying names and fingerprints only.

Source

pub fn headers(&self) -> &ProtectedHeaderSet

Source

pub fn satisfies(&self, metadata: &[HealthCheckHeader]) -> bool

Whether the held values are the ones metadata names.

Source

pub fn to_order(&self) -> SetProtectedHealthCheck

The order a worker receives: trusted fingerprints in place and one freshly copied carrier per value. Each carrier wipes itself on drop.

Source

pub fn to_request(&self) -> Request

The same order as a request, for the caller to encode and drop.

Trait Implementations§

Source§

impl Debug for ProtectedHealthCheck

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.