pub trait StructRecomposer {
// Required methods
fn deconstruct(
&mut self,
concrete_struct_id: ConcreteStructId,
value: VariableId,
) -> OrderedHashMap<MemberId, VariableId>;
fn deconstruct_by_types(
&mut self,
value: VariableId,
types: impl Iterator<Item = TypeId>,
) -> Vec<VariableId>;
fn reconstruct(
&mut self,
concrete_struct_id: ConcreteStructId,
members: Vec<VariableId>,
) -> VariableId;
fn var_ty(&self, var: VariableId) -> TypeId;
fn db(&self) -> &dyn LoweringGroup;
}
Expand description
A trait for deconstructing and constructing structs.
Required Methods§
fn deconstruct( &mut self, concrete_struct_id: ConcreteStructId, value: VariableId, ) -> OrderedHashMap<MemberId, VariableId>
fn deconstruct_by_types( &mut self, value: VariableId, types: impl Iterator<Item = TypeId>, ) -> Vec<VariableId>
fn reconstruct( &mut self, concrete_struct_id: ConcreteStructId, members: Vec<VariableId>, ) -> VariableId
fn var_ty(&self, var: VariableId) -> TypeId
fn db(&self) -> &dyn LoweringGroup
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.