pub struct CommandContexts {
pub parts: Vec<(SegmentTargets, RuntimeContext)>,
pub sensitive_paths: Vec<String>,
}Expand description
The context of every simple command of a line (see
command_contexts).
Fields§
§parts: Vec<(SegmentTargets, RuntimeContext)>Each simple command with the context it runs in.
sensitive_paths: Vec<String>context.sensitive_paths hit by the line.
Implementations§
Source§impl CommandContexts
impl CommandContexts
Sourcepub fn full(&self, config: &ContextConfig) -> RuntimeContext
pub fn full(&self, config: &ContextConfig) -> RuntimeContext
The context of the whole line: for every signal, the most severe value any of its commands runs with.
Sourcepub fn relevant(
&self,
config: &ContextConfig,
groups_of: &dyn Fn(&str) -> HashSet<String>,
all_groups: &HashSet<&str>,
) -> RuntimeContext
pub fn relevant( &self, config: &ContextConfig, groups_of: &dyn Fn(&str) -> HashSet<String>, all_groups: &HashSet<&str>, ) -> RuntimeContext
The context relevant to the risky commands of the line.
groups_of(text) returns the check groups that matched one command
(its SegmentTargets::text). Each command’s context is filtered to
the groups that matched that command (a pod payload always keeps
the k8s signals), and the most severe values are merged. When no
single command matched (a match on the whole line only), every
command counts, filtered by all_groups.
Trait Implementations§
Source§impl Clone for CommandContexts
impl Clone for CommandContexts
Source§impl Debug for CommandContexts
impl Debug for CommandContexts
Auto Trait Implementations§
impl Forget for CommandContexts
impl Freeze for CommandContexts
impl Move for CommandContexts
impl RefUnwindSafe for CommandContexts
impl Send for CommandContexts
impl Sync for CommandContexts
impl Unpin for CommandContexts
impl UnsafeUnpin for CommandContexts
impl UnwindSafe for CommandContexts
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