pub trait Storage: Sized + Default {
type ScopeData: ScopeDataLike;
type VarData: VarDataLike;
// Required methods
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);
}
Required Associated Types§
type ScopeData: ScopeDataLike
type VarData: VarDataLike
Required Methods§
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)
Object Safety§
This trait is not object safe.