pub trait Scope {
// Required methods
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>>;
// Provided method
fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>> { ... }
}Required Methods§
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>>
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".