pub struct Policy {
pub id: String,
pub forbid_import: Option<String>,
pub forbid_call: Option<String>,
pub in_paths: Vec<String>,
pub message: Option<String>,
pub severity: Severity,
}Expand description
One declarative policy (“rule pack” entry): forbid an import and/or a call, optionally only within certain path substrings.
Fields§
§id: StringStable rule id surfaced on findings (e.g. no-requests-in-domain).
forbid_import: Option<String>Forbidden import module prefix (e.g. requests, django.db).
forbid_call: Option<String>Forbidden call callee (e.g. print, os.system, subprocess).
in_paths: Vec<String>Path substrings this policy applies to; empty = whole project.
message: Option<String>Human explanation shown in the finding reason.
severity: SeverityTrait Implementations§
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more