pub struct CommonScope { /* private fields */ }Expand description
Generic hierarchical scope used to resolve fields, methods, nested types, and predicates.
Implementations§
Source§impl CommonScope
impl CommonScope
Sourcepub fn new(core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>) -> Self
pub fn new(core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>) -> Self
Creates an empty scope with an optional parent scope.
Sourcepub fn from_class(
core: Weak<dyn Core>,
scope: Option<Weak<dyn Scope>>,
class_scope: Weak<dyn Scope>,
class: ClassDef,
) -> Rc<Self>
pub fn from_class( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, class_scope: Weak<dyn Scope>, class: ClassDef, ) -> Rc<Self>
Builds a scope populated from a class definition.
Sourcepub fn from_costructor(
core: Weak<dyn Core>,
scope: Option<Weak<dyn Scope>>,
constructor: ConstructorDef,
) -> Self
pub fn from_costructor( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, constructor: ConstructorDef, ) -> Self
Builds a local scope for constructor arguments.
Sourcepub fn from_method(
core: Weak<dyn Core>,
scope: Option<Weak<dyn Scope>>,
method: MethodDef,
) -> Self
pub fn from_method( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, method: MethodDef, ) -> Self
Builds a local scope for method arguments.
Sourcepub fn from_predicate(
core: Weak<dyn Core>,
scope: Option<Weak<dyn Scope>>,
predicate: PredicateDef,
) -> Self
pub fn from_predicate( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, predicate: PredicateDef, ) -> Self
Builds a local scope for predicate arguments.
Sourcepub fn add_problem(&self, problem: ProblemDef)
pub fn add_problem(&self, problem: ProblemDef)
Merges problem-level declarations into this scope.
Trait Implementations§
Source§impl Debug for CommonScope
impl Debug for CommonScope
Source§impl Scope for CommonScope
impl Scope for CommonScope
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>>
fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>>
Auto Trait Implementations§
impl !Freeze for CommonScope
impl !RefUnwindSafe for CommonScope
impl !Send for CommonScope
impl !Sync for CommonScope
impl Unpin for CommonScope
impl UnsafeUnpin for CommonScope
impl !UnwindSafe for CommonScope
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