pub struct PolicyViolation {
pub kind: String,
pub detail: String,
pub effect: Option<String>,
pub path: Option<String>,
pub at: Option<String>,
}Expand description
Structured policy violation, formatted to match spec §6.7’s JSON shape.
Fields§
§kind: String§detail: String§effect: Option<String>Effect kind that was disallowed, or null.
path: Option<String>Path that fell outside the allowlist, or null.
at: Option<String>NodeId or function name; precise location of the offense.
Implementations§
Source§impl PolicyViolation
impl PolicyViolation
pub fn effect_not_allowed(effect: &str, at: impl Into<String>) -> Self
pub fn fs_path_not_allowed( effect: &str, path: &str, at: impl Into<String>, ) -> Self
pub fn budget_exceeded(declared: u64, ceiling: u64) -> Self
Trait Implementations§
Source§impl Clone for PolicyViolation
impl Clone for PolicyViolation
Source§fn clone(&self) -> PolicyViolation
fn clone(&self) -> PolicyViolation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolicyViolation
impl Debug for PolicyViolation
Source§impl<'de> Deserialize<'de> for PolicyViolation
impl<'de> Deserialize<'de> for PolicyViolation
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
Source§impl Display for PolicyViolation
impl Display for PolicyViolation
Source§impl Error for PolicyViolation
impl Error for PolicyViolation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for PolicyViolation
impl RefUnwindSafe for PolicyViolation
impl Send for PolicyViolation
impl Sync for PolicyViolation
impl Unpin for PolicyViolation
impl UnsafeUnpin for PolicyViolation
impl UnwindSafe for PolicyViolation
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