Properly encode/decode structural variants.
Rename encode_struct_field_names to encode_struct_fields to reflect what it actually does
Add a test for cross-crate struct variants
auto merge of #9064 : SiegeLord/rust/external_struct_variants, r=cmr

Fixes issues #5557 and #8746.

This patch adds an additional family for struct-like variants, and encodes some struct-like aspects of such variants that can then be properly decoded by resolve.

Note that I am not 100% sure how this fix works, but it fixes the issue without breaking any of the tests on my machine.