Skip to main content

PolicyDecision

Enum PolicyDecision 

Source
pub enum PolicyDecision {
    AlwaysAllow,
    AskEveryTime,
    NeverAllow,
}
Expand description

The closed §7.1.7 policy-decision vocabulary, as a type.

Same repair, same reasons as ChannelKind above, found by the same audit discipline one field over: the wire field was a bare String the reference validated NOWHERE, while the independent TypeScript implementation refused an unrecognized value at parse — two conformant-claiming implementations reaching opposite verdicts on the same bytes. The reference was the permissive surface, and per the standing guardrail the permissive surface is the wrong one. The published protocol bundle had declared this vocabulary as an enum all along; the reference was the LAST populator without the type.

The doc-comment on the wire field (§7.1.7) carries the semantic warning: this records the human’s standing CONFIGURATION, never the verdict on this act.

Variants§

§

AlwaysAllow

Wire value AlwaysAllow.

§

AskEveryTime

Wire value AskEveryTime — and it stays AskEveryTime after the human approves; the mandate’s existence is what asserts the approval (§9.1 admits no path to issuance that bypasses Approved).

§

NeverAllow

Wire value NeverAllow — recorded, but never yields an envelope.

Implementations§

Source§

impl PolicyDecision

Source

pub const ALL: [Self; 3]

Every member of the closed set, in §7.1.7 order.

Source

pub fn label(&self) -> &'static str

The exact wire spelling. Exhaustive on purpose.

Trait Implementations§

Source§

impl Clone for PolicyDecision

Source§

fn clone(&self) -> PolicyDecision

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PolicyDecision

Source§

impl Debug for PolicyDecision

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PolicyDecision

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for PolicyDecision

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PolicyDecision

Source§

impl FromStr for PolicyDecision

Source§

fn from_str(label: &str) -> Result<Self, Self::Err>

The inverse of PolicyDecision::label. Error shape per [ChannelKind::from_str]’s documentation: a plain message, because §8.3 step 1 classifies an unrecognized value as a strict-parse rejection, below the protocol’s closed set of error codes.

Source§

type Err = String

The associated error which can be returned from parsing.
Source§

impl PartialEq for PolicyDecision

Source§

fn eq(&self, other: &PolicyDecision) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PolicyDecision

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PolicyDecision

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.