Skip to main content

CommonScope

Struct CommonScope 

Source
pub struct CommonScope { /* private fields */ }
Expand description

Generic hierarchical scope used to resolve fields, methods, nested types, and predicates.

Implementations§

Source§

impl CommonScope

Source

pub fn new(core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>) -> Self

Creates an empty scope with an optional parent scope.

Source

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.

Source

pub fn from_costructor( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, constructor: ConstructorDef, ) -> Self

Builds a local scope for constructor arguments.

Source

pub fn from_method( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, method: MethodDef, ) -> Self

Builds a local scope for method arguments.

Source

pub fn from_predicate( core: Weak<dyn Core>, scope: Option<Weak<dyn Scope>>, predicate: PredicateDef, ) -> Self

Builds a local scope for predicate arguments.

Source

pub fn add_problem(&self, problem: ProblemDef)

Merges problem-level declarations into this scope.

Trait Implementations§

Source§

impl Debug for CommonScope

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Scope for CommonScope

Source§

fn core(self: Rc<Self>) -> Rc<dyn Core>

Source§

fn scope(&self) -> Option<Rc<dyn Scope>>

Source§

fn get_field(&self, name: &str) -> Option<Rc<Field>>

Source§

fn get_method(&self, name: &str, types: &[Rc<dyn Type>]) -> Option<Rc<Method>>

Source§

fn get_type(&self, name: &str) -> Option<Rc<dyn Type>>

Source§

fn get_predicate(&self, name: &str) -> Option<Rc<Predicate>>

Source§

fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.