#[non_exhaustive]pub enum PolicyError {
UntrustedOrigin {
command_ref: CommandRef,
},
ForbiddenRiskClass {
command_ref: CommandRef,
},
Denied {
command_ref: CommandRef,
reason_key: String,
},
Unavailable,
BudgetExhausted {
limit: String,
},
}Expand description
Policy evaluation refused a command (spec §14.3, I12).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UntrustedOrigin
The command origin is not trusted enough for the policy.
Fields
command_ref: CommandRefThe command.
ForbiddenRiskClass
The risk class is forbidden in the current configuration (e.g. sandbox).
Fields
command_ref: CommandRefThe command.
Denied
The policy engine denied the command with a reason key.
The policy source could not be consulted; the runtime fails closed.
BudgetExhausted
The turn spent the resource budget its orchestration mode allows (spec §11.1), and stopped rather than continuing on credit.
limit is the stable snake-case name of the bound that ran out, so an
operator can tell “the model was called too often” from “the turn took
too long” without parsing a sentence. The runtime that raises it owns
the vocabulary of names; the library only carries it.
Trait Implementations§
Source§impl Clone for PolicyError
impl Clone for PolicyError
Source§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl<'de> Deserialize<'de> for PolicyError
impl<'de> Deserialize<'de> for PolicyError
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>,
Source§impl Display for PolicyError
impl Display for PolicyError
impl Eq for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<PolicyError> for OrchestratorError
impl From<PolicyError> for OrchestratorError
Source§fn from(value: PolicyError) -> Self
fn from(value: PolicyError) -> Self
Source§impl PartialEq for PolicyError
impl PartialEq for PolicyError
Source§impl Serialize for PolicyError
impl Serialize for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnsafeUnpin for PolicyError
impl UnwindSafe for PolicyError
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
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,
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
key and return true if they are equal.