#[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 Clone for PermissionDenied
impl Clone for PermissionDenied
Source§impl Debug for PermissionDenied
impl Debug for PermissionDenied
Source§impl<'de> Deserialize<'de> for PermissionDenied
impl<'de> Deserialize<'de> for PermissionDenied
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 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.
impl Eq for PermissionDenied
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()
Source§impl PartialEq for PermissionDenied
impl PartialEq for PermissionDenied
Source§impl Serialize for PermissionDenied
impl Serialize for PermissionDenied
impl StructuralPartialEq for PermissionDenied
Auto Trait Implementations§
impl Freeze for PermissionDenied
impl RefUnwindSafe for PermissionDenied
impl Send for PermissionDenied
impl Sync for PermissionDenied
impl Unpin for PermissionDenied
impl UnsafeUnpin for PermissionDenied
impl UnwindSafe for PermissionDenied
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<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.