pub struct Context<'a> {
pub root: &'a Path,
pub index: &'a FileIndex,
pub registry: Option<&'a RuleRegistry>,
pub facts: Option<&'a FactValues>,
pub vars: Option<&'a HashMap<String, String>>,
}Expand description
Execution context handed to each rule during evaluation.
registry— available for rules that need to build and evaluate nested rules at runtime (e.g.for_each_dir). Tests that don’t exercise nested evaluation can set this toNone.facts— resolved fact values, computed once perEngine::run.vars— user-supplied string variables from the config’svars:section.
Fields§
§root: &'a Path§index: &'a FileIndex§registry: Option<&'a RuleRegistry>§facts: Option<&'a FactValues>§vars: Option<&'a HashMap<String, String>>Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
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> 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