pub enum RiskLevel {
None,
Low,
Destructive,
Privileged,
Sensitive,
}Expand description
Consequence class used by policy, confirmation UI, and audit logs.
Variants§
None
Presentation-only or otherwise observational.
Low
A reversible edit or ordinary external effect.
Destructive
Deletes, overwrites, publishes, purchases, or otherwise causes a consequential change that is not cheaply reversible.
Privileged
Crosses an administrative or security boundary.
Sensitive
Reads or exports private user data. It needs an explicit confirmation, but unlike deletion it does not itself alter the source resource.
This is deliberately appended: RiskLevel is also encoded by compact
serde formats, where reordering variants would reinterpret old audit
records and envelopes.
Implementations§
Source§impl RiskLevel
impl RiskLevel
Sourcepub fn requires_confirmation(self) -> bool
pub fn requires_confirmation(self) -> bool
Whether a change of this class must be explicitly confirmed before it runs: deletions and overwrites, crossings of a security boundary, and exports of private data.
Sourcepub fn requires_confirmation_when(self, can_be_undone: bool) -> bool
pub fn requires_confirmation_when(self, can_be_undone: bool) -> bool
Whether a change of this class that can_be_undone must be
confirmed before it runs. Undo is a system service: a deletion Undo
takes back runs at once and offers Undo, and is never asked about.
What Undo cannot take back is still asked: an irreversible deletion,
a crossing of a security boundary, an export of private data.
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The level’s name, as it is written outside a typed message (a question a host relays, an activity facet).
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
The level Self::name names; None for any other word.
Trait Implementations§
impl Copy for RiskLevel
Source§impl<'de> Deserialize<'de> for RiskLevel
impl<'de> Deserialize<'de> for RiskLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RiskLevel
impl StructuralPartialEq for RiskLevel
Auto Trait Implementations§
impl Forget for RiskLevel
impl Freeze for RiskLevel
impl Move for RiskLevel
impl RefUnwindSafe for RiskLevel
impl Send for RiskLevel
impl Sync for RiskLevel
impl Unpin for RiskLevel
impl UnsafeUnpin for RiskLevel
impl UnwindSafe for RiskLevel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more