pub trait Core: Scope + Env {
Show 23 methods
// Required methods
fn new_bool(&self, value: bool) -> Slot;
fn new_bool_var(&self) -> Slot;
fn new_int(&self, value: i64) -> Slot;
fn new_int_var(&self) -> Slot;
fn new_real(&self, num: i64, den: i64) -> Slot;
fn new_real_var(&self) -> Slot;
fn new_string(&self, value: &str) -> Slot;
fn new_string_var(&self) -> Slot;
fn sum(&self, sum: &[Slot]) -> Result<Slot, RiddleError>;
fn opposite(&self, term: Slot) -> Result<Slot, RiddleError>;
fn mul(&self, mul: &[Slot]) -> Result<Slot, RiddleError>;
fn div(&self, left: Slot, right: Slot) -> Result<Slot, RiddleError>;
fn assert(&self, term: Rc<BoolExpr>) -> bool;
fn new_var(
&self,
tp: Rc<dyn Class>,
instances: &[ObjectId],
) -> Result<Slot, RiddleError>;
fn new_disjunction(&self, disjunction: Disjunction);
fn new_object(&self, class: Rc<dyn Class>) -> ObjectId;
fn get_object(&self, id: ObjectId) -> Option<Rc<Object>>;
fn new_atom(
&self,
predicate: Rc<Predicate>,
fact: bool,
args: HashMap<String, Slot>,
) -> AtomId;
fn get_atom(&self, id: AtomId) -> Option<Rc<Atom>>;
// Provided methods
fn bool_type(&self) -> Rc<BoolType> { ... }
fn int_type(&self) -> Rc<IntType> { ... }
fn real_type(&self) -> Rc<RealType> { ... }
fn string_type(&self) -> Rc<StringType> { ... }
}Required Methods§
fn new_bool(&self, value: bool) -> Slot
fn new_bool_var(&self) -> Slot
fn new_int(&self, value: i64) -> Slot
fn new_int_var(&self) -> Slot
fn new_real(&self, num: i64, den: i64) -> Slot
fn new_real_var(&self) -> Slot
fn new_string(&self, value: &str) -> Slot
fn new_string_var(&self) -> Slot
fn sum(&self, sum: &[Slot]) -> Result<Slot, RiddleError>
fn opposite(&self, term: Slot) -> Result<Slot, RiddleError>
fn mul(&self, mul: &[Slot]) -> Result<Slot, RiddleError>
fn div(&self, left: Slot, right: Slot) -> Result<Slot, RiddleError>
fn assert(&self, term: Rc<BoolExpr>) -> bool
fn new_var( &self, tp: Rc<dyn Class>, instances: &[ObjectId], ) -> Result<Slot, RiddleError>
fn new_disjunction(&self, disjunction: Disjunction)
fn new_object(&self, class: Rc<dyn Class>) -> ObjectId
fn get_object(&self, id: ObjectId) -> Option<Rc<Object>>
fn new_atom( &self, predicate: Rc<Predicate>, fact: bool, args: HashMap<String, Slot>, ) -> AtomId
fn get_atom(&self, id: AtomId) -> Option<Rc<Atom>>
Provided Methods§
fn bool_type(&self) -> Rc<BoolType>
fn int_type(&self) -> Rc<IntType>
fn real_type(&self) -> Rc<RealType>
fn string_type(&self) -> Rc<StringType>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".