Enum wasmer_cli::c_gen::CStatement
source · pub enum CStatement {
Declaration {
name: CIdent,
is_extern: bool,
is_const: bool,
ctype: CType,
definition: Option<Box<CStatement>>,
},
LiteralArray {
items: Vec<CStatement>,
},
LiteralConstant {
value: String,
},
Cast {
target_type: CType,
expression: Box<CStatement>,
},
TypeDef {
source_type: CType,
new_name: CIdent,
},
}Expand description
A statement in the C programming language. This may not be exact to what an AST would look like or what the C standard says about the C language, it’s simply a structed way to organize data for generating C code.
Variants
Declaration
Fields
name: CIdentThe name of the thing being declared.
is_extern: boolWhether the thing being declared is extern.
is_const: boolWhether the thing being declared is const.
ctype: CTypeThe type of the thing being declared.
definition: Option<Box<CStatement>>The definition of the thing being declared.
This is useful for initializing constant arrays, for example.
A declaration of some kind.
LiteralArray
Fields
items: Vec<CStatement>The contents of the array.
A literal array of CStatements.
LiteralConstant
Fields
value: StringThe raw value acting as a constant.
A literal constant value, passed through directly as a string.
Cast
A C-style cast
TypeDef
Fields
source_type: CTypeThe type of the thing being typedef’d.
new_name: CIdentThe new name by which this type may be called.
Typedef one type to another.
Trait Implementations
sourceimpl Clone for CStatement
impl Clone for CStatement
sourcefn clone(&self) -> CStatement
fn clone(&self) -> CStatement
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more