Struct resast::Class [−][src]
pub struct Class<'a> {
pub id: Option<Ident<'a>>,
pub super_class: Option<Box<Expr<'a>>>,
pub body: ClassBody<'a>,
}
Expand description
A way to declare object templates
class Thing {
constructor() {
this._a = 0;
}
stuff() {
return 'stuff'
}
set a(value) {
if (value > 100) {
this._a = 0;
} else {
this._a = value;
}
}
get a() {
return this._a;
}
}
let y = class {
constructor() {
this.a = 100;
}
}
Fields
id: Option<Ident<'a>>
super_class: Option<Box<Expr<'a>>>
body: ClassBody<'a>
Implementations
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Class<'a>
impl<'a> UnwindSafe for Class<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more