pub enum ClassElement {
Method {
key: PropName,
is_static: bool,
kind: MethodKind,
func: Box<Function>,
span: Span,
},
Field {
key: PropName,
is_static: bool,
value: Option<Box<Expr>>,
span: Span,
},
StaticBlock {
body: Vec<Stmt>,
body_start: Position,
span: Span,
},
}Expand description
One member of a class body.
Variants§
Method
A method (constructor, ordinary, get, set, generator or async).
Fields
§
kind: MethodKindWhich kind of method this is.
Field
A field (x = 1, #x, static x).
Fields
StaticBlock
static { … }
Trait Implementations§
Source§impl Clone for ClassElement
impl Clone for ClassElement
Source§impl Debug for ClassElement
impl Debug for ClassElement
Source§impl PartialEq for ClassElement
impl PartialEq for ClassElement
impl StructuralPartialEq for ClassElement
Auto Trait Implementations§
impl Forget for ClassElement
impl Freeze for ClassElement
impl Move for ClassElement
impl RefUnwindSafe for ClassElement
impl Send for ClassElementwhere
RawVecInner: Send,
BoxRaw<Expr>: Send,
BoxRaw<Function>: Send,
BoxRaw<Stmt>: Send,
BoxRaw<RestElement>: Send,
BoxRaw<Pattern>: Send,
BoxRaw<MemberPattern>: Send,
BoxRaw<Class>: Send,
BoxRaw<ImportDecl>: Send,
BoxRaw<ExportDecl>: Send,
impl Sync for ClassElementwhere
RawVecInner: Sync,
BoxRaw<Expr>: Sync,
BoxRaw<Function>: Sync,
BoxRaw<Stmt>: Sync,
BoxRaw<RestElement>: Sync,
BoxRaw<Pattern>: Sync,
BoxRaw<MemberPattern>: Sync,
BoxRaw<Class>: Sync,
BoxRaw<ImportDecl>: Sync,
BoxRaw<ExportDecl>: Sync,
impl Unpin for ClassElement
impl UnsafeUnpin for ClassElementwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
*const Function is !null: UnsafeUnpin,
PhantomData<Function>: UnsafeUnpin,
PhantomData<Stmt>: UnsafeUnpin,
impl UnwindSafe for ClassElementwhere
RawVecInner: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
BoxRaw<Function>: UnwindSafe,
BoxRaw<Stmt>: UnwindSafe,
BoxRaw<RestElement>: UnwindSafe,
BoxRaw<Pattern>: UnwindSafe,
BoxRaw<MemberPattern>: UnwindSafe,
BoxRaw<Class>: UnwindSafe,
BoxRaw<ImportDecl>: UnwindSafe,
BoxRaw<ExportDecl>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more