pub struct Access<'a> {
pub solutions: &'a [Solution],
pub index: usize,
pub mutable_keys: &'a HashSet<&'a [Word]>,
}Expand description
All necessary solution access required to check an individual predicate.
Fields§
§solutions: &'a [Solution]The set of input data for each predicate being solved within the solution set.
We require all solutions in order to handle checking predicate exists.
index: usizeChecking is performed for one solution at a time. This index refers to
the checked predicate’s associated solution within the SolutionSet slice.
mutable_keys: &'a HashSet<&'a [Word]>The keys being proposed for mutation for the predicate.
Implementations§
Source§impl<'a> Access<'a>
impl<'a> Access<'a>
Sourcepub fn new(
set: &'a SolutionSet,
solution_index: SolutionIndex,
mutable_keys: &'a HashSet<&[Word]>,
) -> Self
pub fn new( set: &'a SolutionSet, solution_index: SolutionIndex, mutable_keys: &'a HashSet<&[Word]>, ) -> Self
A shorthand for constructing a SolutionAccess instance for checking
the predicate at the given index within the given solution.
This constructor assumes that the given mutable keys contract is correct for this solution. It is not checked by this function for performance.
Sourcepub fn this_solution(&self) -> &Solution
pub fn this_solution(&self) -> &Solution
The solution associated with the predicate currently being checked.
Panics in the case that self.index is out of range of the self.solutions slice.