logo
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: CIdent

The name of the thing being declared.

is_extern: bool

Whether the thing being declared is extern.

is_const: bool

Whether the thing being declared is const.

ctype: CType

The 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: String

The raw value acting as a constant.

A literal constant value, passed through directly as a string.

Cast

Fields

target_type: CType

The type to cast to.

expression: Box<CStatement>

The thing being cast.

A C-style cast

TypeDef

Fields

source_type: CType

The type of the thing being typedef’d.

new_name: CIdent

The new name by which this type may be called.

Typedef one type to another.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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