pub struct SolutionAccess<'a> {
pub data: &'a [SolutionData],
pub index: usize,
pub mutable_keys: &'a HashSet<&'a [Word]>,
}
Expand description
All necessary solution data access required to check an individual predicate.
Fields§
§data: &'a [SolutionData]
The input data for each predicate being solved within the solution.
We require all predicate solution data in order to handle checking predicate exists.
index: usize
Checking is performed for one predicate at a time. This index refers to
the checked predicate’s associated solution data within data
.
mutable_keys: &'a HashSet<&'a [Word]>
The keys being proposed for mutation for the predicate.
Implementations§
Source§impl<'a> SolutionAccess<'a>
impl<'a> SolutionAccess<'a>
Sourcepub fn new(
solution: &'a Solution,
predicate_index: SolutionDataIndex,
mutable_keys: &'a HashSet<&[Word]>,
) -> Self
pub fn new( solution: &'a Solution, predicate_index: SolutionDataIndex, 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_data(&self) -> &SolutionData
pub fn this_data(&self) -> &SolutionData
The solution data associated with the predicate currently being checked.
Panics in the case that self.index
is out of range of the self.data
slice.
Trait Implementations§
Source§impl<'a> Clone for SolutionAccess<'a>
impl<'a> Clone for SolutionAccess<'a>
Source§fn clone(&self) -> SolutionAccess<'a>
fn clone(&self) -> SolutionAccess<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for SolutionAccess<'a>
impl<'a> Debug for SolutionAccess<'a>
impl<'a> Copy for SolutionAccess<'a>
Auto Trait Implementations§
impl<'a> Freeze for SolutionAccess<'a>
impl<'a> RefUnwindSafe for SolutionAccess<'a>
impl<'a> Send for SolutionAccess<'a>
impl<'a> Sync for SolutionAccess<'a>
impl<'a> Unpin for SolutionAccess<'a>
impl<'a> UnwindSafe for SolutionAccess<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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