pub fn stack_satisfies_struct_signature(
    state: &AbstractState,
    struct_index: StructDefinitionIndex,
) -> bool {
    let struct_def = state.module.struct_def_at(struct_index);
    let struct_def = StructDefinitionView::new(&state.module, struct_def);
    let field_token_views = struct_def
        .fields()
        .into_iter()
        .flatten()
        .map(|field| field.type_signature().token());
    let mut satisfied = true;
    for (i, token_view) in field_token_views.enumerate() {
        let abstract_value = AbstractValue {
            token: token_view.as_inner().clone(),
            kind: token_view.kind(&[]),
        };
        if !stack_has(state, i, Some(abstract_value)) {
            satisfied = false;
        }
    }
    satisfied
}
/// Determine whether the struct at the given index can be constructed from the values on
/// the stack.
Determine whether the struct at the given index can be constructed from the values on
the stack.
Determine whether the struct at the given index can be constructed from the values on the stack .
pub fn stack_satisfies_struct_signature(
    state: &AbstractState,
    struct_index: StructDefinitionIndex,
) -> bool {
    let struct_def = state.module.struct_def_at(struct_index);
    let struct_def = StructDefinitionView::new(&state.module, struct_def);
    let field_token_views = struct_def
        .fields()
        .into_iter()
        .flatten()
        .map(|field| field.type_signature().token());
    let mut satisfied = true;
    for (i, token_view) in field_token_views.enumerate() {
        let abstract_value = AbstractValue {
            token: token_view.as_inner().clone(),
            kind: token_view.kind(&[]),
        };
        if !stack_has(state, i, Some(abstract_value)) {
            satisfied = false;
        }
    }
    satisfied
}
pub fn stack_satisfies_struct_signature ( state : & AbstractState , struct_index : StructDefinitionIndex , ) -> bool { let struct_def = state . module . struct_def_at ( struct_index ) ; let struct_def = StructDefinitionView :: new ( & state . module , struct_def ) ; let field_token_views = struct_def . fields ( ) . into_iter ( ) . flatten ( ) . map ( | field | field . type_signature ( ) . token ( ) ) ; let mut satisfied = true ; for ( i , token_view ) in field_token_views . enumerate ( ) { let abstract_value = AbstractValue { token : token_view . as_inner ( ) . clone ( ) , kind : token_view . kind ( & [ ] ) , } ; if ! stack_has ( state , i , Some ( abstract_value ) ) { satisfied = false ; } } satisfied }
Determine whether the struct at the given index can be constructed from the values on
the stack.
Determine whether the struct at the given index can be constructed from the values on the stack .
state
&AbstractState
struct_index
StructDefinitionIndex