pub struct SecretValue(/* private fields */);Expand description
A health-check header value held in memory only.
There is no Clone, Serialize, Deserialize or Display, and Debug
prints a placeholder. The single way to read the bytes is
SecretValue::expose_secret_bytes; call it only for the fingerprint HMAC
and for the controlled in-memory IPC and wire builders.
Implementations§
Source§impl SecretValue
impl SecretValue
Sourcepub fn take_from_ingress(
message: &mut HealthCheckHeaderValue,
) -> Result<Self, SecretValueError>
pub fn take_from_ingress( message: &mut HealthCheckHeaderValue, ) -> Result<Self, SecretValueError>
Move the value out of a generated ingress message.
The allocation moves with std::mem::take, so no copy is made and
the generated field is left empty whether or not the value is accepted.
The value must be UTF-8 and meet the per-value rules every health-check
header meets (no forbidden control byte, no leading or trailing SP or
HTAB); the name is the caller’s to validate.
Sourcepub fn expose_secret_bytes(&self) -> &[u8] ⓘ
pub fn expose_secret_bytes(&self) -> &[u8] ⓘ
The clear bytes. The name is the warning: the only legitimate callers are the fingerprint HMAC and the controlled in-memory IPC and wire builders that carry the value onward.