Struct libffi::middle::Type [] [src]

pub struct Type(_);

Represents a single C type.

Example

Suppose we have a C struct:

struct my_struct {
    uint16_t f1;
    uint64_t f2;
};

To pass the struct by value via libffi, we need to construct a Type object describing its layout:

use libffi::middle::Type;

let my_struct = Type::structure(vec![
    Type::u64(),
    Type::u16(),
]);

Methods

impl Type
[src]

[src]

Returns the representation of the C void type.

This is used only for the return type of a CIF, not for an argument or struct member.

[src]

Returns the unsigned 8-bit numeric type.

[src]

Returns the signed 8-bit numeric type.

[src]

Returns the unsigned 16-bit numeric type.

[src]

Returns the signed 16-bit numeric type.

[src]

Returns the unsigned 32-bit numeric type.

[src]

Returns the signed 32-bit numeric type.

[src]

Returns the unsigned 64-bit numeric type.

[src]

Returns the signed 64-bit numeric type.

[src]

Returns the C equivalent of Rust usize (u64).

[src]

Returns the C equivalent of Rust isize (i64).

[src]

Returns the C signed char type.

[src]

Returns the C unsigned char type.

[src]

Returns the C short type.

[src]

Returns the C unsigned short type.

[src]

Returns the C int type.

[src]

Returns the C unsigned int type.

[src]

Returns the C long type.

[src]

Returns the C unsigned long type.

[src]

Returns the C longlong type.

[src]

Returns the C unsigned longlong type.

[src]

Returns the C float (32-bit floating point) type.

[src]

Returns the C double (64-bit floating point) type.

[src]

Returns the C void* type, for passing any kind of pointer.

[src]

Returns the C long double (extended-precision floating point) type.

[src]

Constructs a structure type whose fields have the given types.

[src]

Gets a raw pointer to the underlying ffi_type.

This method may be useful for interacting with the low and raw layers.

Trait Implementations

impl Debug for Type
[src]

[src]

Formats the value using the given formatter. Read more

impl Drop for Type
[src]

[src]

Executes the destructor for this type. Read more

impl Clone for Type
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more