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
Auto Trait Implementations
impl RefUnwindSafe for CStatement
impl Send for CStatement
impl Sync for CStatement
impl Unpin for CStatement
impl UnwindSafe for CStatement
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
