pub trait Scope {
// Required methods
fn core(self: Rc<Self>) -> Rc<dyn Core>;
fn scope(&self) -> Option<Rc<dyn Scope>>;
fn get_field(&self, name: &str) -> Option<Rc<Field>>;
fn get_method(
&self,
name: &str,
types: &[Rc<dyn Type>],
) -> Option<Rc<Method>>;
fn get_type(&self, name: &str) -> Option<Rc<dyn Type>>;
fn get_predicate(&self, name: &str) -> Option<Rc<Predicate>>;
// Provided method
fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>> { ... }
}Expand description
Name-resolution contract shared by classes, methods, predicates, and global scopes.