fn decode_map_inner_int_float(map: &HashMap<MapKey, Value>, value_type: i8) -> K{
    let keys = new_list(qtype::INT_LIST, map.len() as i64);
    let values = new_list(value_type, map.len() as i64);
    let keys_slice = keys.as_mut_slice::<I>();
    let values_slice = values.as_mut_slice::<F>();
    match value_type{
        qtype::FLOAT_LIST => {
            map.iter().enumerate().for_each(|(i, (key, value))|{
                keys_slice[i] = key.as_i32().unwrap();
                values_slice[i] = value.as_f64().unwrap();
            });
        },
        qtype::DATETIME_LIST => {
            map.iter().enumerate().for_each(|(i, (key, value))|{
                keys_slice[i] = key.as_i32().unwrap();
                values_slice[i] = value.as_message().unwrap().get_field_by_name("days").unwrap().as_f64().unwrap();
            });
        },
        // There are no other int compatible type
        _ => unreachable!()
    }
    new_dictionary(keys, values)
}
/// Decode map of int key and float compatible value into q dictionary.
Decode map of int key and float compatible value into q dictionary.
Decode map of int key and float compatible value into q dictionary .
fn decode_map_inner_int_float(map: &HashMap<MapKey, Value>, value_type: i8) -> K{
    let keys = new_list(qtype::INT_LIST, map.len() as i64);
    let values = new_list(value_type, map.len() as i64);
    let keys_slice = keys.as_mut_slice::<I>();
    let values_slice = values.as_mut_slice::<F>();
    match value_type{
        qtype::FLOAT_LIST => {
            map.iter().enumerate().for_each(|(i, (key, value))|{
                keys_slice[i] = key.as_i32().unwrap();
                values_slice[i] = value.as_f64().unwrap();
            });
        },
        qtype::DATETIME_LIST => {
            map.iter().enumerate().for_each(|(i, (key, value))|{
                keys_slice[i] = key.as_i32().unwrap();
                values_slice[i] = value.as_message().unwrap().get_field_by_name("days").unwrap().as_f64().unwrap();
            });
        },
        // There are no other int compatible type
        _ => unreachable!()
    }
    new_dictionary(keys, values)
}
fn decode_map_inner_int_float ( map : & HashMap < MapKey , Value > , value_type : i8 ) -> K { let keys = new_list ( qtype :: INT_LIST , map . len ( ) as i64 ) ; let values = new_list ( value_type , map . len ( ) as i64 ) ; let keys_slice = keys . as_mut_slice :: < I > ( ) ; let values_slice = values . as_mut_slice :: < F > ( ) ; match value_type { qtype :: FLOAT_LIST => { map . iter ( ) . enumerate ( ) . for_each ( | ( i , ( key , value ) ) | { keys_slice [ i ] = key . as_i32 ( ) . unwrap ( ) ; values_slice [ i ] = value . as_f64 ( ) . unwrap ( ) ; } ) ; } , qtype :: DATETIME_LIST => { map . iter ( ) . enumerate ( ) . for_each ( | ( i , ( key , value ) ) | { keys_slice [ i ] = key . as_i32 ( ) . unwrap ( ) ; values_slice [ i ] = value . as_message ( ) . unwrap ( ) . get_field_by_name ( " " ) . unwrap ( ) . as_f64 ( ) . unwrap ( ) ; } ) ; } , // There are no other int compatible type _ => unreachable ! ( ) } new_dictionary ( keys , values ) }
Decode map of int key and float compatible value into q dictionary.
Decode map of int key and float compatible value into q dictionary .
map
&HashMap<MapKey, Value>
value_type
i8
map
&HashMap<MapKey, Value>
value_type
i8