pub struct PolicyConfig {
pub settings: Vec<PolicySetting>,
pub forbidden_strings: ForbiddenStringsOptions,
pub markdown_autofix: MarkdownAutofixOptions,
}Expand description
What: Every policy’s severity plus the option records of option-bearing policies. Why: One value answers “does this policy run, how strictly, with what options”.
In TS you’d write (pseudocode):
type PolicyConfig = { settings: PolicySetting[];
forbiddenStrings: ForbiddenStringsOptions; markdownAutofix: MarkdownAutofixOptions };Fields§
§settings: Vec<PolicySetting>One row per registry policy, in registry order.
forbidden_strings: ForbiddenStringsOptionsOptions of security/forbidden-strings,
defaults applied.
markdown_autofix: MarkdownAutofixOptionsOptions of markdown/autofix,
defaults applied.
Implementations§
Source§impl PolicyConfig
Defaults and lookup for policy settings.
impl PolicyConfig
Defaults and lookup for policy settings.
Sourcepub fn defaults() -> PolicyConfig
pub fn defaults() -> PolicyConfig
What: Build the settings of a repository whose configuration names no policy, or that has no configuration file at all. Why: Parsing starts from these values and replaces only the policies the file names.
In TS you’d write (pseudocode):
static defaults(): PolicyConfig;Sourcepub fn setting(&self, id: PolicyId) -> PolicySetting
pub fn setting(&self, id: PolicyId) -> PolicySetting
What:
Read the effective setting of one policy.
&self borrows this record.
Why:
Callers ask by typed identity instead of scanning the list themselves.
In TS you’d write (pseudocode):
setting(id: PolicyId): PolicySetting;Trait Implementations§
Source§impl Clone for PolicyConfig
impl Clone for PolicyConfig
Source§impl Debug for PolicyConfig
impl Debug for PolicyConfig
impl Eq for PolicyConfig
Source§impl PartialEq for PolicyConfig
impl PartialEq for PolicyConfig
impl StructuralPartialEq for PolicyConfig
Auto Trait Implementations§
impl Freeze for PolicyConfig
impl RefUnwindSafe for PolicyConfig
impl Send for PolicyConfig
impl Sync for PolicyConfig
impl Unpin for PolicyConfig
impl UnsafeUnpin for PolicyConfig
impl UnwindSafe for PolicyConfig
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,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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