Struct stc_ts_env::Env
source · [−]pub struct Env {
pub(crate) stable: StableEnv,
pub(crate) rule: Rule,
pub(crate) target: EsVersion,
pub(crate) module: ModuleConfig,
pub(crate) builtin: Arc<BuiltIn>,
pub(crate) global_types: Arc<Mutex<FxHashMap<JsWord, Type>>>,
pub(crate) global_vars: Arc<Mutex<FxHashMap<JsWord, Type>>>,
}
Expand description
Stuffs which can be changed between runs.
Fields
stable: StableEnv
rule: Rule
target: EsVersion
module: ModuleConfig
builtin: Arc<BuiltIn>
global_types: Arc<Mutex<FxHashMap<JsWord, Type>>>
global_vars: Arc<Mutex<FxHashMap<JsWord, Type>>>
Implementations
sourceimpl Env
impl Env
pub fn new(
env: StableEnv,
rule: Rule,
target: EsVersion,
module: ModuleConfig,
builtin: Arc<BuiltIn>
) -> Self
pub const fn target(&self) -> EsVersion
pub const fn module(&self) -> ModuleConfig
pub const fn rule(&self) -> Rule
pub fn declare_global_var(&mut self, name: JsWord, ty: Type)
pub fn declare_global_type(&mut self, name: JsWord, ty: Type)
pub fn get_global_var(&self, span: Span, name: &JsWord) -> Result<Type, Error>
pub fn get_global_type(&self, span: Span, name: &JsWord) -> Result<Type, Error>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl !UnwindSafe for Env
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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