Trait swipl::term::Unifiable

source ·
pub unsafe trait Unifiable {
    // Required method
    fn unify(&self, term: &Term<'_>) -> bool;
}
Expand description

Trait for term unification.

Safety

This is marked unsafe because in order to do term unification, we must be sure that

  • the term is created on the engine which is currently active
  • the given context is a context for this engine

Not checking those preconditions results in undefined behavior. Therefore, care must be taken to ensure that unify is actually safe.

The macro [unifiable!] provides a way to safely implement this trait by doing the precondition checks for you.

Required Methods§

source

fn unify(&self, term: &Term<'_>) -> bool

Unify this data with the given term reference.

You’d generally not use this directly, but rather, go through Term::unify.

Implementations on Foreign Types§

source§

impl<'a> Unifiable for &str

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a> Unifiable for &[u8]

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a> Unifiable for bool

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a> Unifiable for f64

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a> Unifiable for i64

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a> Unifiable for u64

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a> Unifiable for String

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<'a, T> Unifiable for &'a [T]
where &'a T: 'a + Unifiable,

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<T: ArcBlob> Unifiable for Arc<T>

source§

fn unify(&self, term: &Term<'_>) -> bool

source§

impl<T: Unifiable> Unifiable for &T

source§

fn unify(&self, term: &Term<'_>) -> bool

Implementors§

source§

impl<'a> Unifiable for Atomable<'a>

source§

impl<'a> Unifiable for Atom

source§

impl<'a> Unifiable for DictBuilder<'a>

source§

impl<'a> Unifiable for Functor

source§

impl<'a> Unifiable for Record

source§

impl<'a> Unifiable for Nil

source§

impl<'a> Unifiable for Term<'a>