Enum interoptopus::lang::c::CType[][src]

pub enum CType {
    Primitive(PrimitiveType),
    Array(ArrayType),
    Enum(EnumType),
    Opaque(OpaqueType),
    Composite(CompositeType),
    FnPointer(FnPointerType),
    ReadPointer(Box<CType>),
    ReadWritePointer(Box<CType>),
    Pattern(TypePattern),
}
Expand description

A type that can exist at the FFI boundary.

Variants

Primitive

Tuple Fields of Primitive

0: PrimitiveType
Array

Tuple Fields of Array

0: ArrayType
Enum

Tuple Fields of Enum

0: EnumType
Opaque

Tuple Fields of Opaque

0: OpaqueType
Composite

Tuple Fields of Composite

0: CompositeType
FnPointer

Tuple Fields of FnPointer

0: FnPointerType
ReadPointer

Tuple Fields of ReadPointer

0: Box<CType>
ReadWritePointer

Tuple Fields of ReadWritePointer

0: Box<CType>
Pattern

Special patterns with primitives existing on C-level but special semantics. useful to higher level languages.

Tuple Fields of Pattern

0: TypePattern

Implementations

Produces a name unique for that type with respect to this library.

The name here is supposed to uniquely determine a type relative to a Library, but it is not guaranteed to be C-compatible and may contain special characters (e.g., *const u32).

Backends should instead match on the CType variant and determine a more appropriate name on a case-by-case basis; including changing a name entirely.

Lists all other types this type refers to.

If this was a pointer type, tries to deref it and return the inner type.

Convenience method attempting to convert the contained type as a composite.

Convenience method attempting to convert the contained type as an opaque.

Checks if this is a PrimitiveType::Void.

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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)

recently added

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.