pub enum ClassMember {
Field {
name: Ident,
modifiers: ClassModifiers,
optional: bool,
ty: TypeAnnotation,
initializer: Option<ExprId>,
span: Span,
doc: Option<DocComment>,
},
Method {
name: Ident,
optional: bool,
modifiers: ClassModifiers,
generics: Vec<Ident>,
params: Vec<ParamDecl>,
return_type: TypeAnnotation,
body: StmtId,
span: Span,
doc: Option<DocComment>,
},
Constructor {
visibility: Visibility,
params: Vec<ParamDecl>,
body: StmtId,
span: Span,
doc: Option<DocComment>,
},
Accessor {
name: Ident,
modifiers: ClassModifiers,
kind: AccessorKind,
param: Option<Box<ParamDecl>>,
return_type: Option<TypeAnnotation>,
body: StmtId,
span: Span,
doc: Option<DocComment>,
},
}Variants§
Field
Method
Constructor
Fields
§
visibility: Visibilityprivate constructor: only the class’s own module may call it or
extend the class.
§
doc: Option<DocComment>Accessor
get x(): T { … } or set x(v: T) { … }. Get/set of the same name pair
into one property; the typechecker validates and pairs them.
Fields
§
modifiers: ClassModifiers§
kind: AccessorKind§
param: Option<Box<ParamDecl>>The setter’s single parameter; None for a getter. Boxed to keep the
variant near its siblings’ size (clippy large_enum_variant).
§
return_type: Option<TypeAnnotation>The getter’s return type; None for a setter.
§
doc: Option<DocComment>Trait Implementations§
Source§impl Clone for ClassMember
impl Clone for ClassMember
Source§impl Debug for ClassMember
impl Debug for ClassMember
Source§impl PartialEq for ClassMember
impl PartialEq for ClassMember
impl StructuralPartialEq for ClassMember
Auto Trait Implementations§
impl Freeze for ClassMember
impl RefUnwindSafe for ClassMember
impl Send for ClassMember
impl Sync for ClassMember
impl Unpin for ClassMember
impl UnsafeUnpin for ClassMember
impl UnwindSafe for ClassMember
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