Struct repc_impl::layout::Record[][src]

pub struct Record<I: Layout> {
    pub kind: RecordKind,
    pub fields: Vec<RecordField<I>>,
}

A record.

This corresponds to a struct or a union in C.

Example

#pragma pack(8)
struct {
    int i __attribute__((aligned(16)));
    char :1;
};
Type::<()> {
    layout: (),
    annotations: vec!(Annotation::PragmaPack(64)),
    variant: TypeVariant::Record(Record::<()> {
        kind: RecordKind::Struct,
        fields: vec![
            RecordField {
                layout: None,
                annotations: vec!(Annotation::Align(Some(128))),
                named: true,
                bit_width: None,
                ty: Type {
                    layout: (),
                    annotations: vec!(),
                    variant: TypeVariant::Builtin(BuiltinType::Int),
                },
            },
            RecordField {
                layout: None,
                annotations: vec!(),
                named: false,
                bit_width: Some(1),
                ty: Type {
                    layout: (),
                    annotations: vec!(),
                    variant: TypeVariant::Builtin(BuiltinType::Char),
                },
            },
        ],
    }),
};

Fields

kind: RecordKind

The type of the record. Struct or union.

fields: Vec<RecordField<I>>

The fields of the record.

Trait Implementations

impl<I: Clone + Layout> Clone for Record<I>[src]

impl<I: Debug + Layout> Debug for Record<I>[src]

impl<I: Eq + Layout> Eq for Record<I>[src]

impl<I: PartialEq + Layout> PartialEq<Record<I>> for Record<I>[src]

impl<I: Layout> StructuralEq for Record<I>[src]

impl<I: Layout> StructuralPartialEq for Record<I>[src]

Auto Trait Implementations

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

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

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

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

impl<I> UnwindSafe for Record<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.