Enum wasmer_cli::c_gen::CType

source ·
pub enum CType {
Show 15 variants Void, PointerTo { is_const: bool, inner: Box<CType>, }, U8, U16, U32, U64, USize, I8, I16, I32, I64, ISize, Function { arguments: Vec<CType>, return_value: Option<Box<CType>>, }, Array { inner: Box<CType>, }, TypeDef(String),
}
Expand description

A Type in the C language.

Variants

Void

C void type.

PointerTo

Fields

is_const: bool

Whether the pointer is const.

inner: Box<CType>

The type that the pointer points to.

A pointer to some other type.

U8

C 8 bit unsigned integer type.

U16

C 16 bit unsigned integer type.

U32

C 32 bit unsigned integer type.

U64

C 64 bit unsigned integer type.

USize

C pointer sized unsigned integer type.

I8

C 8 bit signed integer type.

I16

C 16 bit signed integer type.

I32

C 32 bit signed integer type.

I64

C 64 bit signed integer type.

ISize

C pointer sized signed integer type.

Function

Fields

arguments: Vec<CType>

The arguments the function takes.

return_value: Option<Box<CType>>

The return value if it has one

None is equivalent to Some(Box(Ctype::Void)).

A function or function pointer.

Array

Fields

inner: Box<CType>

The type of the array.

C constant array.

TypeDef(String)

A user defined type.

Implementations

Convenience function to get a mutable void pointer type.

Convenience function to get a const void pointer type.

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
Returns the “default value” for a type. 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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type for metadata in pointers and references to Self.
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.
upcast ref
upcast mut ref
upcast boxed dyn
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