Struct erg_compiler::context::Context
source · [−]pub struct Context { /* private fields */ }
Expand description
Represents the context of the current scope
Implementations
sourceimpl Context
impl Context
pub fn new(
name: Str,
kind: ContextKind,
params: Vec<ParamSpec>,
outer: Option<Context>,
super_classes: Vec<Type>,
super_traits: Vec<Type>,
level: usize
) -> Self
pub fn with_capacity(
name: Str,
kind: ContextKind,
params: Vec<ParamSpec>,
outer: Option<Context>,
super_classes: Vec<Type>,
super_traits: Vec<Type>,
capacity: usize,
level: usize
) -> Self
pub fn mono(
name: Str,
kind: ContextKind,
outer: Option<Context>,
super_classes: Vec<Type>,
super_traits: Vec<Type>,
level: usize
) -> Self
pub fn poly(
name: Str,
kind: ContextKind,
params: Vec<ParamSpec>,
outer: Option<Context>,
super_classes: Vec<Type>,
super_traits: Vec<Type>,
level: usize
) -> Self
pub fn poly_trait<S: Into<Str>>(
name: S,
params: Vec<ParamSpec>,
supers: Vec<Type>,
level: usize
) -> Self
pub fn poly_class<S: Into<Str>>(
name: S,
params: Vec<ParamSpec>,
super_classes: Vec<Type>,
impl_traits: Vec<Type>,
level: usize
) -> Self
pub fn mono_trait<S: Into<Str>>(name: S, supers: Vec<Type>, level: usize) -> Self
pub fn mono_class<S: Into<Str>>(
name: S,
super_classes: Vec<Type>,
super_traits: Vec<Type>,
level: usize
) -> Self
pub fn poly_patch<S: Into<Str>>(
name: S,
params: Vec<ParamSpec>,
patch_classes: Vec<Type>,
impl_traits: Vec<Type>,
level: usize
) -> Self
pub fn module(name: Str, capacity: usize) -> Self
pub fn caused_by(&self) -> Str
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more