cairo_lang_lowering::lower::refs

Trait StructRecomposer

source
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§

source

fn deconstruct( &mut self, concrete_struct_id: ConcreteStructId, value: VariableId, ) -> OrderedHashMap<MemberId, VariableId>

source

fn deconstruct_by_types( &mut self, value: VariableId, types: impl Iterator<Item = TypeId>, ) -> Vec<VariableId>

source

fn reconstruct( &mut self, concrete_struct_id: ConcreteStructId, members: Vec<VariableId>, ) -> VariableId

source

fn var_ty(&self, var: VariableId) -> TypeId

source

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.

Implementors§