Export encode_struct and decode_struct functions