pub enum Stmt {
Show 16 variants
VarDecl {
name: String,
type_qualifier: Option<TypeQualifier>,
type_annotation: Option<String>,
initializer: Option<Expr>,
var_kind: VarKind,
loc: Loc,
},
Assignment {
target: Expr,
value: Expr,
},
TupleAssignment {
names: Vec<String>,
value: Expr,
loc: Loc,
},
Expression(Expr),
If {
condition: Expr,
then_branch: Vec<Stmt>,
else_if_branches: Vec<(Expr, Vec<Stmt>)>,
else_branch: Option<Vec<Stmt>>,
},
For {
var_name: String,
from: Expr,
to: Expr,
step: Option<Expr>,
body: Vec<Stmt>,
loc: Loc,
},
ForIn {
index_var: Option<String>,
item_var: String,
collection: Expr,
body: Vec<Stmt>,
loc: Loc,
},
While {
condition: Expr,
body: Vec<Stmt>,
},
Break {
loc: Loc,
},
Continue {
loc: Loc,
},
TypeDecl {
name: String,
fields: Vec<TypeField>,
export: bool,
loc: Loc,
},
MethodDecl {
name: String,
params: Vec<MethodParam>,
body: Vec<Stmt>,
export: bool,
loc: Loc,
},
EnumDecl {
name: String,
fields: Vec<EnumField>,
export: bool,
loc: Loc,
},
FunctionDecl {
name: String,
params: Vec<FunctionParam>,
body: Vec<Stmt>,
export: bool,
loc: Loc,
},
Export {
item: ExportItem,
},
Import {
path: String,
alias: String,
loc: Loc,
},
}Variants§
VarDecl
Fields
§
type_qualifier: Option<TypeQualifier>Assignment
TupleAssignment
Expression(Expr)
If
Fields
For
ForIn
While
Break
Continue
TypeDecl
MethodDecl
EnumDecl
FunctionDecl
Export
Fields
§
item: ExportItemImport
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stmt
impl<'de> Deserialize<'de> for Stmt
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Stmt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Stmt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Stmt
impl Serialize for Stmt
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin for Stmt
impl UnwindSafe for Stmt
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