pub trait Type: Debug {
// Required methods
fn name(&self) -> &str;
fn as_any(self: Rc<Self>) -> Rc<dyn Any>;
fn new_instance(self: Rc<Self>) -> Rc<dyn Var>;
// Provided methods
fn full_name(&self) -> String { ... }
fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>> { ... }
fn as_predicate(self: Rc<Self>) -> Option<Rc<Predicate>> { ... }
}Expand description
Runtime type abstraction used by the interpreter.
Implementors expose type identity, optional downcasts to richer kinds (class or predicate), and a way to create a default runtime instance.