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),
}
Expand description
An enum of all available types.
Variants
Builtin(BuiltinType)
Tuple Fields
0: BuiltinType
A builtin type.
Record(Record<I>)
Tuple Fields
0: Record<I>
A record. Struct or union.
Typedef(Box<Type<I>, Global>)
A typedef.
The box contains the target type.
Array(Array<I>)
Tuple Fields
0: Array<I>
An array.
Enum(Vec<i128, Global>)
An enum.
The vector contains the values of the variants.
Opaque(<I as Layout>::OpaqueLayout)
Tuple Fields
0: <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
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>,
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>,
Returns the identical type variant with the Layout
converted.
Trait Implementations
impl<I> PartialEq<TypeVariant<I>> for TypeVariant<I> where
I: PartialEq<I> + Layout,
<I as Layout>::OpaqueLayout: PartialEq<<I as Layout>::OpaqueLayout>,
impl<I> PartialEq<TypeVariant<I>> for TypeVariant<I> where
I: PartialEq<I> + Layout,
<I as Layout>::OpaqueLayout: PartialEq<<I as Layout>::OpaqueLayout>,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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,
impl<I> Send for TypeVariant<I> where
<I as Layout>::FieldLayout: Send,
<I as Layout>::OpaqueLayout: Send,
<I as Layout>::TypeLayout: Send,
impl<I> Sync for TypeVariant<I> where
<I as Layout>::FieldLayout: Sync,
<I as Layout>::OpaqueLayout: Sync,
<I as Layout>::TypeLayout: Sync,
impl<I> Unpin for TypeVariant<I> where
<I as Layout>::FieldLayout: Unpin,
<I as Layout>::OpaqueLayout: Unpin,
<I as Layout>::TypeLayout: Unpin,
impl<I> UnwindSafe for TypeVariant<I> where
<I as Layout>::FieldLayout: UnwindSafe,
<I as Layout>::OpaqueLayout: UnwindSafe,
<I as Layout>::TypeLayout: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more