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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
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
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
impl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
sourcefn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
sourcefn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
sourceimpl<T> Upcastable for T where
T: 'static + Any + Debug,
impl<T> Upcastable for T where
T: 'static + Any + Debug,
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_box(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
