pub trait Rule: Send + Sync {
// Required methods
fn check(
&self,
state: &mut RuleState,
line: u32,
instruction: &Instruction,
shell: Option<&ParsedShell>,
);
fn code(&self) -> &RuleCode;
fn severity(&self) -> Severity;
fn message(&self) -> &str;
// Provided method
fn finalize(&self, state: RuleState) -> Vec<CheckFailure> { ... }
}Expand description
A rule that can check Dockerfile instructions.
Required Methods§
Sourcefn check(
&self,
state: &mut RuleState,
line: u32,
instruction: &Instruction,
shell: Option<&ParsedShell>,
)
fn check( &self, state: &mut RuleState, line: u32, instruction: &Instruction, shell: Option<&ParsedShell>, )
Check an instruction and potentially add failures to the state.
Provided Methods§
Sourcefn finalize(&self, state: RuleState) -> Vec<CheckFailure>
fn finalize(&self, state: RuleState) -> Vec<CheckFailure>
Finalize the rule and return any additional failures. Called after all instructions have been processed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".