pub enum Term {
Atom(AtomId),
Var(VarId),
Integer(i64),
Float(f64),
Compound {
functor: AtomId,
args: Vec<Term>,
},
List {
head: Box<Term>,
tail: Box<Term>,
},
}Expand description
Prolog term representation.
Variants§
Implementations§
Source§impl Term
impl Term
Sourcepub fn functor_arity(&self) -> Option<(AtomId, usize)>
pub fn functor_arity(&self) -> Option<(AtomId, usize)>
Extract functor AtomId and arity for a term used as a goal/head.
- Atom: (atom_id, 0)
- Compound: (functor, len(args))
- Others: None
Sourcepub fn first_arg_key(&self) -> Option<FirstArgKey>
pub fn first_arg_key(&self) -> Option<FirstArgKey>
Extract the first-argument indexing key from a term used as a clause head.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Term
impl<'de> Deserialize<'de> for Term
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnsafeUnpin for Term
impl UnwindSafe for Term
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