pub enum RiskClass {
ReadOnly,
ReversibleLowRisk,
SensitiveDataChange,
Destructive,
Irreversible,
ExternalRegulated,
}Expand description
Risk class of a command, ordered from harmless to regulated (spec §14.3).
Deliberately exhaustive: the ladder is a closed, ordered vocabulary and callers compare against it rather than match it open-endedly.
Variants§
ReadOnly
No mutation.
ReversibleLowRisk
Easily reversible, low impact.
SensitiveDataChange
Changes sensitive data.
Destructive
Deletes or destroys data.
Irreversible
Cannot be undone.
ExternalRegulated
An external effect another party decides (an airline, a bank, a regulator).
Implementations§
Source§impl RiskClass
impl RiskClass
Sourcepub const fn conservative() -> Self
pub const fn conservative() -> Self
The class assumed when nothing declares one: Self::Irreversible.
Used as the serde default wherever an unannotated record would otherwise be read as harmless.
Sourcepub fn needs_trusted_origin(self) -> bool
pub fn needs_trusted_origin(self) -> bool
Returns true when the class needs a trusted origin on its own,
regardless of the confirmation policy (I12).
Trait Implementations§
impl Copy for RiskClass
Source§impl<'de> Deserialize<'de> for RiskClass
impl<'de> Deserialize<'de> for RiskClass
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RiskClass
Source§impl JsonSchema for RiskClass
impl JsonSchema for RiskClass
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for RiskClass
impl Ord for RiskClass
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for RiskClass
impl PartialOrd for RiskClass
impl StructuralPartialEq for RiskClass
Auto Trait Implementations§
impl Freeze for RiskClass
impl RefUnwindSafe for RiskClass
impl Send for RiskClass
impl Sync for RiskClass
impl Unpin for RiskClass
impl UnsafeUnpin for RiskClass
impl UnwindSafe for RiskClass
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.