Trait Storage

Source
pub trait Storage: Sized + Default {
    type ScopeData: ScopeDataLike;
    type VarData: VarDataLike;

Show 14 methods // Required methods fn new(collect_prop_atom: bool) -> Self; fn need_collect_prop_atom(&self) -> bool; fn add_property_atom(&mut self, atom: Atom); fn scope(&mut self, ctxt: SyntaxContext) -> &mut Self::ScopeData; fn top_scope(&mut self) -> &mut Self::ScopeData; fn var_or_default(&mut self, id: Id) -> &mut Self::VarData; fn merge(&mut self, kind: ScopeKind, child: Self); fn report_usage(&mut self, ctx: Ctx, i: Id); fn report_assign(&mut self, ctx: Ctx, i: Id, is_op: bool, ty: Value<Type>); fn declare_decl( &mut self, ctx: Ctx, i: &Ident, init_type: Option<Value<Type>>, kind: Option<VarDeclKind>, ) -> &mut Self::VarData; fn get_initialized_cnt(&self) -> usize; fn truncate_initialized_cnt(&mut self, len: usize); fn mark_property_mutation(&mut self, id: Id); fn get_var_data(&self, id: Id) -> Option<&Self::VarData>;
}

Required Associated Types§

Required Methods§

Source

fn new(collect_prop_atom: bool) -> Self

Source

fn need_collect_prop_atom(&self) -> bool

Source

fn add_property_atom(&mut self, atom: Atom)

Source

fn scope(&mut self, ctxt: SyntaxContext) -> &mut Self::ScopeData

Source

fn top_scope(&mut self) -> &mut Self::ScopeData

Source

fn var_or_default(&mut self, id: Id) -> &mut Self::VarData

Source

fn merge(&mut self, kind: ScopeKind, child: Self)

Source

fn report_usage(&mut self, ctx: Ctx, i: Id)

Source

fn report_assign(&mut self, ctx: Ctx, i: Id, is_op: bool, ty: Value<Type>)

Source

fn declare_decl( &mut self, ctx: Ctx, i: &Ident, init_type: Option<Value<Type>>, kind: Option<VarDeclKind>, ) -> &mut Self::VarData

Source

fn get_initialized_cnt(&self) -> usize

Source

fn truncate_initialized_cnt(&mut self, len: usize)

Source

fn mark_property_mutation(&mut self, id: Id)

Source

fn get_var_data(&self, id: Id) -> Option<&Self::VarData>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§