pub struct Array<I: Layout> {
pub element_type: Box<Type<I>>,
pub num_elements: Option<u64>,
}
Expand description
An array.
This corresponds to the type of T var[N]
in C.
§Example
int i[1];
Array::<()> {
element_type: Box::new(Type {
layout: (),
annotations: vec!(),
variant: TypeVariant::Builtin(BuiltinType::Int),
}),
num_elements: Some(1),
};
Fields§
§element_type: Box<Type<I>>
The type of elements of the array.
num_elements: Option<u64>
The number of elements in the array.
If this is None
, it corresponds to a flexible array in C.
Trait Implementations§
impl<I: Eq + Layout> Eq for Array<I>
impl<I: Layout> StructuralPartialEq for Array<I>
Auto Trait Implementations§
impl<I> Freeze for Array<I>
impl<I> RefUnwindSafe for Array<I>where
<I as Layout>::TypeLayout: RefUnwindSafe,
<I as Layout>::OpaqueLayout: RefUnwindSafe,
<I as Layout>::FieldLayout: RefUnwindSafe,
impl<I> Send for Array<I>where
<I as Layout>::TypeLayout: Send,
<I as Layout>::OpaqueLayout: Send,
<I as Layout>::FieldLayout: Send,
impl<I> Sync for Array<I>where
<I as Layout>::TypeLayout: Sync,
<I as Layout>::OpaqueLayout: Sync,
<I as Layout>::FieldLayout: Sync,
impl<I> Unpin for Array<I>
impl<I> UnwindSafe for Array<I>where
<I as Layout>::TypeLayout: UnwindSafe,
<I as Layout>::OpaqueLayout: UnwindSafe,
<I as Layout>::FieldLayout: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more