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§
type ScopeData: ScopeDataLike
type VarData: VarDataLike
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>
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.