pub struct CommonScope { /* private fields */ }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(parent_scope: Weak<dyn Scope>, class: ClassDef) -> Rc<Self>
pub fn from_class(parent_scope: Weak<dyn Scope>, class: ClassDef) -> Rc<Self>
Builds a scope populated from a class definition.
Sourcepub fn from_constructor(
parent_scope: Weak<dyn Class>,
constructor: ConstructorDef,
) -> Self
pub fn from_constructor( parent_scope: Weak<dyn Class>, constructor: ConstructorDef, ) -> Self
Builds a local scope for constructor arguments.
Sourcepub fn from_function(
parent_scope: Weak<dyn Scope>,
function: FunctionDef,
) -> Self
pub fn from_function( parent_scope: Weak<dyn Scope>, function: FunctionDef, ) -> Self
Builds a local scope for function arguments.
Sourcepub fn from_predicate(
parent_scope: Weak<dyn Scope>,
predicate: PredicateDef,
) -> Self
pub fn from_predicate( parent_scope: Weak<dyn Scope>, predicate: PredicateDef, ) -> Self
Builds a local scope for predicate arguments.
Sourcepub fn add_problem(self: Rc<Self>, problem: ProblemDef)
pub fn add_problem(self: Rc<Self>, problem: ProblemDef)
Merges problem-level declarations into this scope.
Trait Implementations§
Source§impl Scope for CommonScope
impl Scope for CommonScope
fn core(&self) -> Rc<dyn Core>
fn scope(&self) -> Option<Rc<dyn Scope>>
fn get_type(&self, name: &str) -> Option<Rc<dyn Type>>
fn get_predicate(&self, name: &str) -> Option<Rc<Predicate>>
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 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