pub struct Predicate { /* private fields */ }Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn new(scope: Weak<dyn Scope>, predicate: PredicateDef) -> Rc<Self>
pub fn new(scope: Weak<dyn Scope>, predicate: PredicateDef) -> Rc<Self>
Creates a predicate from its parsed definition.
pub fn parents(&self) -> &[Vec<String>]
pub fn args(&self) -> &[(Vec<String>, String)]
pub fn statements(&self) -> &[Statement]
Sourcepub fn call(self: Rc<Self>, atom: Rc<Atom>) -> Result<(), RiddleError>
pub fn call(self: Rc<Self>, atom: Rc<Atom>) -> Result<(), RiddleError>
Executes predicate statements against a concrete atom.
pub fn atoms(&self) -> Vec<AtomId>
Trait Implementations§
Source§impl Scope for Predicate
impl Scope for Predicate
fn core(&self) -> Rc<dyn Core>
fn scope(&self) -> Option<Rc<dyn Scope>>
fn get_fields(&self) -> Vec<Rc<Field>>
fn get_field(&self, name: &str) -> Option<Rc<Field>>
fn get_function( &self, name: &str, types: &[Rc<dyn Type>], ) -> Option<Rc<Function>>
fn get_type(&self, name: &str) -> Option<Rc<dyn Type>>
fn get_predicate(&self, name: &str) -> Option<Rc<Predicate>>
fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>>
Auto Trait Implementations§
impl !Freeze for Predicate
impl !RefUnwindSafe for Predicate
impl !Send for Predicate
impl !Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl !UnwindSafe for Predicate
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