pub struct PolicyViolation {
pub policy_name: String,
pub rule: String,
pub location: Option<CodeLocation>,
pub message: String,
pub suggestion: Option<String>,
}Expand description
A policy violation found during validation.
Fields§
§policy_name: StringName of the policy that was violated
rule: StringSpecific rule within the policy
location: Option<CodeLocation>Location in the code where the violation occurred
message: StringHuman-readable message explaining the violation
suggestion: Option<String>Suggestion for how to fix the violation
Implementations§
Source§impl PolicyViolation
impl PolicyViolation
pub fn new( policy_name: impl Into<String>, rule: impl Into<String>, message: impl Into<String>, ) -> Self
pub fn with_location(self, location: CodeLocation) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> 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 · 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
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