[][src]Enum uniffi_bindgen::interface::types::Type

pub enum Type {
    UInt8,
    Int8,
    UInt16,
    Int16,
    UInt32,
    Int32,
    UInt64,
    Int64,
    Float32,
    Float64,
    Boolean,
    String,
    Object(String),
    Record(String),
    Enum(String),
    Error(String),
    Optional(Box<Type>),
    Sequence(Box<Type>),
    Map(Box<Type>),
}

Represents all the different high-level types that can be used in a component interface. At this level we identify user-defined types by name, without knowing any details of their internal structure apart from what type of thing they are (record, enum, etc).

Variants

UInt8
Int8
UInt16
Int16
UInt32
Int32
UInt64
Int64
Float32
Float64
Boolean
String
Object(String)
Record(String)
Enum(String)
Error(String)
Optional(Box<Type>)
Sequence(Box<Type>)
Map(Box<Type>)

Implementations

impl Type[src]

pub fn to_ffi(&self) -> FFIType[src]

impl Type[src]

pub fn canonical_name(&self) -> String[src]

Get the canonical, unique-within-this-component name for a type.

When generating helper code for foreign language bindings, it's sometimes useful to be able to name a particular type in order to e.g. call a helper function that is specific to that type. We support this by defining a naming convention where each type gets a unique canonical name, constructed recursively from the names of its component types (if any).

Trait Implementations

impl Clone for Type[src]

impl Debug for Type[src]

impl Eq for Type[src]

impl<'_> From<&'_ Type> for FFIType[src]

When passing data across the FFI, each Type value will be lowered into a corresponding FFIType value. This conversion tells you which one.

impl Hash for Type[src]

impl PartialEq<Type> for Type[src]

impl StructuralEq for Type[src]

impl StructuralPartialEq for Type[src]

Auto Trait Implementations

impl RefUnwindSafe for Type

impl Send for Type

impl Sync for Type

impl Unpin for Type

impl UnwindSafe for Type

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.