pub struct Relation { /* private fields */ }Expand description
A set of facts sharing the same predicate.
Implementations§
Source§impl Relation
impl Relation
Sourcepub fn insert(&mut self, fact: Fact) -> bool
pub fn insert(&mut self, fact: Fact) -> bool
Insert a fact. Returns true if the fact was not already present.
Sourcepub fn contains(&self, fact: &Fact) -> bool
pub fn contains(&self, fact: &Fact) -> bool
Check whether the relation contains the given fact.
Sourcepub fn union(&self, other: &Relation) -> Relation
pub fn union(&self, other: &Relation) -> Relation
Compute the union of two relations (facts from both).
Sourcepub fn difference(&self, other: &Relation) -> Relation
pub fn difference(&self, other: &Relation) -> Relation
Compute the set-difference self − other.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Relation
impl RefUnwindSafe for Relation
impl Send for Relation
impl Sync for Relation
impl Unpin for Relation
impl UnsafeUnpin for Relation
impl UnwindSafe for Relation
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