Trait swipl::term::TermGetable
source · pub unsafe trait TermGetable: Sized {
// Required methods
fn get(term: &Term<'_>) -> Option<Self>;
fn name() -> &'static str;
}
Expand description
Trait for getting data from a term reference.
Safety
This is marked unsafe because in order to do term getting, 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 get
is
actually safe.
The macro [term_getable!] provides a way to safely implement this trait by doing the precondition checks for you.
Required Methods§
Object Safety§
This trait is not object safe.