pub struct NestedRuleSpec {
pub kind: String,
pub paths: Option<PathsSpec>,
pub message: Option<String>,
pub policy_url: Option<String>,
pub when: Option<String>,
pub scope_filter: Option<ScopeFilterSpec>,
pub extra: Mapping,
}Expand description
Rule specification for nested rules (e.g. the require: block of
for_each_dir). Unlike RuleSpec, id and level are synthesized
from the parent rule — users just supply the kind plus kind-specific
options, optionally with a message / policy_url / when.
Fields§
§kind: String§paths: Option<PathsSpec>§message: Option<String>§policy_url: Option<String>§when: Option<String>§scope_filter: Option<ScopeFilterSpec>Per-file scope filter — see RuleSpec::scope_filter
for semantics. Inherited unchanged when
NestedRuleSpec::instantiate synthesises a full
RuleSpec per-iteration.
extra: MappingImplementations§
Source§impl NestedRuleSpec
impl NestedRuleSpec
Sourcepub fn instantiate(
&self,
parent_id: &str,
idx: usize,
level: Level,
tokens: &PathTokens,
) -> RuleSpec
pub fn instantiate( &self, parent_id: &str, idx: usize, level: Level, tokens: &PathTokens, ) -> RuleSpec
Synthesize a full RuleSpec for a single iteration, applying
path-template substitution (using the iterated entry’s tokens) to
every string field. The resulting spec has id = "{parent_id}.require[{idx}]" and inherits level from the parent.
Trait Implementations§
Source§impl Clone for NestedRuleSpec
impl Clone for NestedRuleSpec
Source§fn clone(&self) -> NestedRuleSpec
fn clone(&self) -> NestedRuleSpec
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 NestedRuleSpec
impl Debug for NestedRuleSpec
Source§impl<'de> Deserialize<'de> for NestedRuleSpec
impl<'de> Deserialize<'de> for NestedRuleSpec
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 NestedRuleSpec
impl RefUnwindSafe for NestedRuleSpec
impl Send for NestedRuleSpec
impl Sync for NestedRuleSpec
impl Unpin for NestedRuleSpec
impl UnsafeUnpin for NestedRuleSpec
impl UnwindSafe for NestedRuleSpec
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> 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>
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