pub enum CallerRole {
Observer,
Dev,
Admin,
Boot,
}Expand description
Caller privilege tier, ordered least to most privileged.
Variant order is the privilege order and Ord is derived from it, so
caller >= required is the authorization comparison. This mirrors what
v0.2.10 did for PlanRiskLevel; CallerRole kept a hand-written
role_rank match until now, which is a second encoding of the same
ordering that could drift from this declaration.
Adding a variant means placing it at the correct privilege position, not appending it.
Variants§
Implementations§
Source§impl CallerRole
impl CallerRole
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Stable lowercase spelling, identical to the serde representation.
The audit chain signs this string, so it is a wire format: renaming a
variant must not silently change what past signatures were made over.
format!("{role:?}") cannot be used for that — Debug carries no
stability promise and tracks the identifier. caller_role_as_str_matches_serde
pins the two encodings together.
Trait Implementations§
Source§impl Clone for CallerRole
impl Clone for CallerRole
Source§fn clone(&self) -> CallerRole
fn clone(&self) -> CallerRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more