pub struct Policy {
pub version: u32,
pub extends: Vec<PathBuf>,
pub engine: EngineConfig,
pub workspace: WorkspaceConfig,
pub output: OutputConfig,
pub adapters: AdaptersConfig,
pub rules: BTreeMap<String, RuleSettings>,
pub scopes: Vec<ScopeConfig>,
}Fields§
§version: u32§extends: Vec<PathBuf>§engine: EngineConfig§workspace: WorkspaceConfig§output: OutputConfig§adapters: AdaptersConfig§rules: BTreeMap<String, RuleSettings>§scopes: Vec<ScopeConfig>Implementations§
Source§impl Policy
impl Policy
pub fn default_with_rules( default_rules: impl IntoIterator<Item = (String, RuleSettings)>, ) -> Self
pub fn from_path(path: &Path) -> Result<Self, ConfigError>
pub fn validate(&self, path: &Path) -> Result<(), ConfigError>
pub fn rule_enabled_anywhere(&self, rule_id: &str, default_level: Level) -> bool
pub fn rule_settings( &self, rule_id: &str, file_path: Option<&Path>, default_level: Level, ) -> RuleSettings
pub fn decode_rule<T>(
&self,
rule_id: &str,
file_path: Option<&Path>,
) -> Result<T, ConfigError>where
T: RuleOptions,
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Policy
impl<'de> Deserialize<'de> for Policy
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 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