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
impl ProtectedHealthCheck
Sourcepub fn from_ingress(
key: &FingerprintKey,
order: &mut SetProtectedHealthCheck,
) -> Result<Self, ProtectedHealthCheckError>
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.
Sourcepub fn from_trusted(
order: &mut SetProtectedHealthCheck,
) -> Result<Self, ProtectedHealthCheckError>
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.
Sourcepub fn from_parts(
cluster_id: String,
config: HealthCheckConfig,
headers: ProtectedHeaderSet,
) -> Result<Self, ProtectedHealthCheckError>
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.
pub fn cluster_id(&self) -> &str
Sourcepub fn config(&self) -> &HealthCheckConfig
pub fn config(&self) -> &HealthCheckConfig
The configuration, headers carrying names and fingerprints only.
pub fn headers(&self) -> &ProtectedHeaderSet
Sourcepub fn satisfies(&self, metadata: &[HealthCheckHeader]) -> bool
pub fn satisfies(&self, metadata: &[HealthCheckHeader]) -> bool
Whether the held values are the ones metadata names.
Sourcepub fn to_order(&self) -> SetProtectedHealthCheck
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.
Sourcepub fn to_request(&self) -> Request
pub fn to_request(&self) -> Request
The same order as a request, for the caller to encode and drop.