Enum repc::layout::TypeVariant[][src]

pub enum TypeVariant<I> where
    I: Layout
{ Builtin(BuiltinType), Record(Record<I>), Typedef(Box<Type<I>, Global>), Array(Array<I>), Enum(Vec<i128, Global>), Opaque(<I as Layout>::OpaqueLayout), }

An enum of all available types.

Variants

Builtin(BuiltinType)

A builtin type.

Record(Record<I>)

A record. Struct or union.

Typedef(Box<Type<I>, Global>)

A typedef.

The box contains the target type.

Array(Array<I>)

An array.

Enum(Vec<i128, Global>)

An enum.

The vector contains the values of the variants.

Opaque(<I as Layout>::OpaqueLayout)

An opaque type.

This does not correspond to anything in C. It is useful if the layout of a nested type is already known and should not be recomputed. On all supported targets, substituting a type for the opaque type with the same layout leads to the same layout for the containing type.

Implementations

impl<I> TypeVariant<I> where
    I: Layout
[src]

pub fn into<J>(self) -> TypeVariant<J> where
    J: Layout,
    <I as Layout>::TypeLayout: Into<<J as Layout>::TypeLayout>,
    <I as Layout>::FieldLayout: Into<<J as Layout>::FieldLayout>,
    <I as Layout>::OpaqueLayout: Into<<J as Layout>::OpaqueLayout>, 
[src]

Returns the identical type variant with the Layout converted.

Trait Implementations

impl<I> Clone for TypeVariant<I> where
    I: Layout + Clone,
    <I as Layout>::OpaqueLayout: Clone
[src]

impl<I> Debug for TypeVariant<I> where
    I: Layout + Debug,
    <I as Layout>::OpaqueLayout: Debug
[src]

impl<I> Eq for TypeVariant<I> where
    I: Layout + Eq,
    <I as Layout>::OpaqueLayout: Eq
[src]

impl<I> PartialEq<TypeVariant<I>> for TypeVariant<I> where
    I: Layout + PartialEq<I>,
    <I as Layout>::OpaqueLayout: PartialEq<<I as Layout>::OpaqueLayout>, 
[src]

impl<I> StructuralEq for TypeVariant<I> where
    I: Layout
[src]

impl<I> StructuralPartialEq for TypeVariant<I> where
    I: Layout
[src]

Auto Trait Implementations

impl<I> RefUnwindSafe for TypeVariant<I> where
    <I as Layout>::FieldLayout: RefUnwindSafe,
    <I as Layout>::OpaqueLayout: RefUnwindSafe,
    <I as Layout>::TypeLayout: RefUnwindSafe
[src]

impl<I> Send for TypeVariant<I> where
    <I as Layout>::FieldLayout: Send,
    <I as Layout>::OpaqueLayout: Send,
    <I as Layout>::TypeLayout: Send
[src]

impl<I> Sync for TypeVariant<I> where
    <I as Layout>::FieldLayout: Sync,
    <I as Layout>::OpaqueLayout: Sync,
    <I as Layout>::TypeLayout: Sync
[src]

impl<I> Unpin for TypeVariant<I> where
    <I as Layout>::FieldLayout: Unpin,
    <I as Layout>::OpaqueLayout: Unpin,
    <I as Layout>::TypeLayout: Unpin
[src]

impl<I> UnwindSafe for TypeVariant<I> where
    <I as Layout>::FieldLayout: UnwindSafe,
    <I as Layout>::OpaqueLayout: UnwindSafe,
    <I as Layout>::TypeLayout: UnwindSafe
[src]

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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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.