pub struct Aggregate(pub Index);
Expand description
A collection of Type
s.
XXX I’ve added Array as using Aggregate in the hope ExtractValue could be used just like with struct aggregates, but it turns out we need ExtractElement (which takes an index Value). So Aggregate can be a ‘struct’ or ‘array’ but you only ever use them with Struct and Array types and with ExtractValue and ExtractElement… so they’re orthogonal and we can simplify aggregate again to be only for structs.
But also to keep Type as Copy we need to put the Array meta into another copy type (rather than
recursing with Box
Tuple Fields
0: Index
Implementations
sourceimpl Aggregate
impl Aggregate
sourcepub fn new_struct(context: &mut Context, field_types: Vec<Type>) -> Self
pub fn new_struct(context: &mut Context, field_types: Vec<Type>) -> Self
Return a new struct specific aggregate.
sourcepub fn new_array(context: &mut Context, element_type: Type, count: u64) -> Self
pub fn new_array(context: &mut Context, element_type: Type, count: u64) -> Self
Returna new array specific aggregate.
sourcepub fn get_field_type(&self, context: &Context, indices: &[u64]) -> Option<Type>
pub fn get_field_type(&self, context: &Context, indices: &[u64]) -> Option<Type>
Get the type of (nested) aggregate fields, if found.
sourcepub fn get_elem_type(&self, context: &Context) -> Option<Type>
pub fn get_elem_type(&self, context: &Context) -> Option<Type>
Get the type of the array element, if applicable.
Trait Implementations
impl Copy for Aggregate
impl Eq for Aggregate
impl StructuralEq for Aggregate
impl StructuralPartialEq for Aggregate
Auto Trait Implementations
impl RefUnwindSafe for Aggregate
impl Send for Aggregate
impl Sync for Aggregate
impl Unpin for Aggregate
impl UnwindSafe for Aggregate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more