pub struct PolicyFingerprint(/* private fields */);Expand description
A deterministic digest of a policy’s identity, scope, and configuration.
Storage backends include this value in counter keys. Consequently, changing any storage-relevant policy configuration starts an independent counter instead of reinterpreting existing state.
This storage-key component deliberately does not implement Serde traits.
Implementations§
Source§impl PolicyFingerprint
impl PolicyFingerprint
Sourcepub const fn from_digest(digest: [u8; 32]) -> Self
pub const fn from_digest(digest: [u8; 32]) -> Self
Constructs a fingerprint from an already domain-separated digest.
This is intended for third-party RateLimitPolicy implementations.
The digest must cover the algorithm identity and every
storage-relevant policy field. Deployment-only fields such as
QuotaMode should be excluded so a mode change reuses warmed state.
Built-in policies derive their fingerprints automatically.
Sourcepub const fn into_bytes(self) -> [u8; 32]
pub const fn into_bytes(self) -> [u8; 32]
Consumes the value and returns the 32-byte SHA-256 fingerprint.
Trait Implementations§
Source§impl Clone for PolicyFingerprint
impl Clone for PolicyFingerprint
Source§fn clone(&self) -> PolicyFingerprint
fn clone(&self) -> PolicyFingerprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more