#[non_exhaustive]pub struct PermissionDenied {
pub caller: String,
pub capability: String,
pub reason: String,
/* private fields */
}Expand description
Marker for a capability denial that should surface to the guest as the
built-in PermissionDeniedError subclass, carrying the structured fields
policy-aware recovery code reads (e.capability, e.caller, e.reason).
Same contract as RangeError.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.caller: String§capability: String§reason: StringImplementations§
Source§impl PermissionDenied
impl PermissionDenied
Sourcepub fn is_policy(&self) -> bool
pub fn is_policy(&self) -> bool
Whether the operator’s policy refused, as opposed to a runtime invariant
refusing ahead of it. A caller that treats a denial as a filter rather
than an error — session.list omitting keys the policy hides — must act
only on the policy’s answer; an invariant denial means the check itself
could not be made, which no filter may swallow.
Trait Implementations§
Source§impl Debug for PermissionDenied
impl Debug for PermissionDenied
Source§impl Display for PermissionDenied
impl Display for PermissionDenied
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
The denial message an LLM sees. The closing paragraph is load-bearing: observed models treat a denial as an obstacle and reroute through raw HTTP or another package, so the message itself must say the decision is final. The two variants differ in what “final” means — a policy decision is the operator’s to change, an invariant is nobody’s.
Source§impl Error for PermissionDenied
impl Error for PermissionDenied
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()