Struct repc::layout::Record [−][src]
pub struct Record<I> where
I: Layout, {
pub kind: RecordKind,
pub fields: Vec<RecordField<I>, Global>,
}
Expand description
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>, Global>
The fields of the record.
Trait Implementations
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,
impl<I> Send for Record<I> where
<I as Layout>::FieldLayout: Send,
<I as Layout>::OpaqueLayout: Send,
<I as Layout>::TypeLayout: Send,
impl<I> Sync for Record<I> where
<I as Layout>::FieldLayout: Sync,
<I as Layout>::OpaqueLayout: Sync,
<I as Layout>::TypeLayout: Sync,
impl<I> Unpin for Record<I> where
<I as Layout>::FieldLayout: Unpin,
<I as Layout>::OpaqueLayout: Unpin,
<I as Layout>::TypeLayout: Unpin,
impl<I> UnwindSafe for Record<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