pub struct InverseContext<T, B> { /* private fields */ }Expand description
Inverse context.
Implementations§
Source§impl<T, B> InverseContext<T, B>
impl<T, B> InverseContext<T, B>
Source§impl<T: Hash + Eq, B: Hash + Eq> InverseContext<T, B>
impl<T: Hash + Eq, B: Hash + Eq> InverseContext<T, B>
Sourcepub fn contains(&self, term: &Term<T, B>) -> bool
pub fn contains(&self, term: &Term<T, B>) -> bool
Checks whether the given term has an inverse definition.
Sourcepub fn insert(&mut self, term: Term<T, B>, value: InverseDefinition<T>)
pub fn insert(&mut self, term: Term<T, B>, value: InverseDefinition<T>)
Binds the given inverse definition to term, replacing any previous
binding.
Sourcepub fn get(&self, term: &Term<T, B>) -> Option<&InverseDefinition<T>>
pub fn get(&self, term: &Term<T, B>) -> Option<&InverseDefinition<T>>
Returns the value bound to the given key, if any.
Sourcepub fn get_mut(
&mut self,
term: &Term<T, B>,
) -> Option<&mut InverseDefinition<T>>
pub fn get_mut( &mut self, term: &Term<T, B>, ) -> Option<&mut InverseDefinition<T>>
Returns a mutable reference to the value bound to the given key, if any.
Sourcepub fn select(
&self,
var: &Term<T, B>,
containers: &[Container],
selection: &Selection<'_, T>,
) -> Option<&Key>where
T: Clone,
pub fn select(
&self,
var: &Term<T, B>,
containers: &[Container],
selection: &Selection<'_, T>,
) -> Option<&Key>where
T: Clone,
Selects the term to compact var with, trying containers in
preference order and matching selection within the first container
that has entries. Returns None if var has no inverse definition
or nothing matches.
Trait Implementations§
Source§impl<T, B> Default for InverseContext<T, B>
impl<T, B> Default for InverseContext<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for InverseContext<T, B>
impl<T, B> RefUnwindSafe for InverseContext<T, B>
impl<T, B> Send for InverseContext<T, B>
impl<T, B> Sync for InverseContext<T, B>
impl<T, B> Unpin for InverseContext<T, B>
impl<T, B> UnsafeUnpin for InverseContext<T, B>
impl<T, B> UnwindSafe for InverseContext<T, B>
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
Unordered reference.