Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field has incomplete type for recursive types definitions (declaration order) #832

Closed
tmpfs opened this issue May 17, 2023 · 3 comments
Closed
Labels

Comments

@tmpfs
Copy link

tmpfs commented May 17, 2023

When declaring recursive type definitions it appears that the typedef's are declared in the wrong order causing this error:

api_generated.h:120:22: error: field has incomplete type 'struct wire_Secret'

Please see this issue for more context.

The type definitions without irrelevant fields look like this roughly:

struct SecretRow {
  secret: Secret,
}

struct UserData {
  fields: Vec<SecretRow>,
}

enum Secret {
  Note {
    user_data: UserData,
  }
}

Here is the complete header file (generated using flutter_rust_bridge_codegen - which calls out to cbindgen) when I don't apply my fix in build.rs:

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct _Dart_Handle* Dart_Handle;

typedef struct DartCObject DartCObject;

typedef int64_t DartPort;

typedef bool (*DartPostCObjectFnType)(DartPort port_id, void *message);

typedef struct wire_uint_8_list {
  uint8_t *ptr;
  int32_t len;
} wire_uint_8_list;

typedef struct wire_StringList {
  struct wire_uint_8_list **ptr;
  int32_t len;
} wire_StringList;

typedef struct wire_TrustedDevice {
  struct wire_uint_8_list *public_key;
  struct wire_uint_8_list *extra_info;
  struct wire_uint_8_list *created_date;
  struct wire_uint_8_list *address;
  struct wire_uint_8_list *peer_id;
} wire_TrustedDevice;

typedef struct wire_list_secret_type {
  int32_t *ptr;
  int32_t len;
} wire_list_secret_type;

typedef struct wire_DocumentView_All {
  struct wire_list_secret_type *ignored_types;
} wire_DocumentView_All;

typedef struct wire_DocumentView_Vault {
  struct wire_uint_8_list *field0;
} wire_DocumentView_Vault;

typedef struct wire_DocumentView_TypeId {
  int32_t field0;
} wire_DocumentView_TypeId;

typedef struct wire_DocumentView_Favorites {

} wire_DocumentView_Favorites;

typedef struct wire_DocumentView_Tags {
  struct wire_StringList *field0;
} wire_DocumentView_Tags;

typedef struct wire_list_kind {
  int32_t *ptr;
  int32_t len;
} wire_list_kind;

typedef struct wire_DocumentView_Contact {
  struct wire_list_kind *include_types;
} wire_DocumentView_Contact;

typedef struct wire_DocumentView_Documents {
  struct wire_uint_8_list *vault_id;
  struct wire_StringList *identifiers;
} wire_DocumentView_Documents;

typedef union DocumentViewKind {
  struct wire_DocumentView_All *All;
  struct wire_DocumentView_Vault *Vault;
  struct wire_DocumentView_TypeId *TypeId;
  struct wire_DocumentView_Favorites *Favorites;
  struct wire_DocumentView_Tags *Tags;
  struct wire_DocumentView_Contact *Contact;
  struct wire_DocumentView_Documents *Documents;
} DocumentViewKind;

typedef struct wire_DocumentView {
  int32_t tag;
  union DocumentViewKind *kind;
} wire_DocumentView;

typedef struct wire_list_document_view {
  struct wire_DocumentView *ptr;
  int32_t len;
} wire_list_document_view;

typedef struct wire_ArchiveFilter {
  struct wire_uint_8_list *id;
  bool include_documents;
} wire_ArchiveFilter;

typedef struct wire_QueryFilter {
  struct wire_StringList *tags;
  struct wire_StringList *folders;
  struct wire_list_secret_type *types;
} wire_QueryFilter;

typedef struct wire_Summary {
  uint16_t version;
  struct wire_uint_8_list *id;
  struct wire_uint_8_list *name;
  uint8_t algorithm;
  uint64_t flags;
} wire_Summary;

typedef struct wire_SecretMeta {
  int32_t kind;
  uint32_t flags;
  struct wire_uint_8_list *label;
  struct wire_uint_8_list *last_updated;
  struct wire_StringList *tags;
  bool favorite;
} wire_SecretMeta;

typedef struct wire_SecretRow {
  struct wire_uint_8_list *id;
  struct wire_SecretMeta meta;
  struct wire_Secret secret;
} wire_SecretRow;

typedef struct wire_list_secret_row {
  struct wire_SecretRow *ptr;
  int32_t len;
} wire_list_secret_row;

typedef struct wire_UserData {
  struct wire_list_secret_row *fields;
  struct wire_uint_8_list *comment;
  struct wire_uint_8_list *recovery_note;
} wire_UserData;

typedef struct wire_Secret_Account {
  struct wire_uint_8_list *account;
  struct wire_uint_8_list *password;
  struct wire_uint_8_list *url;
  struct wire_UserData *user_data;
} wire_Secret_Account;

typedef struct wire_Secret_Note {
  struct wire_uint_8_list *text;
  struct wire_UserData *user_data;
} wire_Secret_Note;

typedef struct wire_Pid {
  uint64_t local;
  uint64_t *source;
} wire_Pid;

typedef struct wire_list_pid {
  struct wire_Pid *ptr;
  int32_t len;
} wire_list_pid;

typedef struct wire_TypeParameter_Home {

} wire_TypeParameter_Home;

typedef struct wire_TypeParameter_Work {

} wire_TypeParameter_Work;

typedef struct wire_TypeParameter_Telephone {
  int32_t field0;
} wire_TypeParameter_Telephone;

typedef struct wire_TypeParameter_Related {
  int32_t field0;
} wire_TypeParameter_Related;

typedef struct wire_TypeParameter_Extension {
  struct wire_uint_8_list *field0;
} wire_TypeParameter_Extension;

typedef union TypeParameterKind {
  struct wire_TypeParameter_Home *Home;
  struct wire_TypeParameter_Work *Work;
  struct wire_TypeParameter_Telephone *Telephone;
  struct wire_TypeParameter_Related *Related;
  struct wire_TypeParameter_Extension *Extension;
} TypeParameterKind;

typedef struct wire_TypeParameter {
  int32_t tag;
  union TypeParameterKind *kind;
} wire_TypeParameter;

typedef struct wire_list_type_parameter {
  struct wire_TypeParameter *ptr;
  int32_t len;
} wire_list_type_parameter;

typedef struct wire_TimeZoneParameter_Text {
  struct wire_uint_8_list *field0;
} wire_TimeZoneParameter_Text;

typedef struct wire_TimeZoneParameter_Uri {
  struct wire_uint_8_list *field0;
} wire_TimeZoneParameter_Uri;

typedef struct wire_TimeZoneParameter_UtcOffset {
  int8_t hours;
  int8_t minutes;
  int8_t seconds;
} wire_TimeZoneParameter_UtcOffset;

typedef union TimeZoneParameterKind {
  struct wire_TimeZoneParameter_Text *Text;
  struct wire_TimeZoneParameter_Uri *Uri;
  struct wire_TimeZoneParameter_UtcOffset *UtcOffset;
} TimeZoneParameterKind;

typedef struct wire_TimeZoneParameter {
  int32_t tag;
  union TimeZoneParameterKind *kind;
} wire_TimeZoneParameter;

typedef struct wire_Extension {
  struct wire_uint_8_list *name;
  struct wire_StringList *value;
} wire_Extension;

typedef struct wire_list_extension {
  struct wire_Extension *ptr;
  int32_t len;
} wire_list_extension;

typedef struct wire_Parameters {
  struct wire_uint_8_list *language;
  int32_t *value;
  uint8_t *pref;
  struct wire_uint_8_list *alt_id;
  struct wire_list_pid *pid;
  struct wire_list_type_parameter *types;
  struct wire_uint_8_list *media_type;
  struct wire_uint_8_list *calscale;
  struct wire_StringList *sort_as;
  struct wire_uint_8_list *geo;
  struct wire_TimeZoneParameter *timezone;
  struct wire_uint_8_list *label;
  struct wire_list_extension *extensions;
} wire_Parameters;

typedef struct wire_UriProperty {
  struct wire_uint_8_list *group;
  struct wire_uint_8_list *value;
  struct wire_Parameters *parameters;
} wire_UriProperty;

typedef struct wire_list_uri_property {
  struct wire_UriProperty *ptr;
  int32_t len;
} wire_list_uri_property;

typedef struct wire_KindProperty {
  struct wire_uint_8_list *group;
  int32_t value;
  struct wire_Parameters *parameters;
} wire_KindProperty;

typedef struct wire_TextProperty {
  struct wire_uint_8_list *group;
  struct wire_uint_8_list *value;
  struct wire_Parameters *parameters;
} wire_TextProperty;

typedef struct wire_list_text_property {
  struct wire_TextProperty *ptr;
  int32_t len;
} wire_list_text_property;

typedef struct wire_TextListProperty {
  struct wire_uint_8_list *group;
  struct wire_StringList *value;
  struct wire_Parameters *parameters;
  int32_t delimiter;
} wire_TextListProperty;

typedef struct wire_TextOrUriProperty_Text {
  struct wire_TextProperty *field0;
} wire_TextOrUriProperty_Text;

typedef struct wire_TextOrUriProperty_Uri {
  struct wire_UriProperty *field0;
} wire_TextOrUriProperty_Uri;

typedef union TextOrUriPropertyKind {
  struct wire_TextOrUriProperty_Text *Text;
  struct wire_TextOrUriProperty_Uri *Uri;
} TextOrUriPropertyKind;

typedef struct wire_TextOrUriProperty {
  int32_t tag;
  union TextOrUriPropertyKind *kind;
} wire_TextOrUriProperty;

typedef struct wire_list_text_or_uri_property {
  struct wire_TextOrUriProperty *ptr;
  int32_t len;
} wire_list_text_or_uri_property;

typedef struct wire_CalendarDate {
  int32_t year;
  struct wire_uint_8_list *month;
  uint8_t day;
} wire_CalendarDate;

typedef struct wire_DateAndOrTime_Date {
  struct wire_CalendarDate *field0;
} wire_DateAndOrTime_Date;

typedef struct wire_DateAndOrTime_DateTime {
  struct wire_uint_8_list *field0;
} wire_DateAndOrTime_DateTime;

typedef struct wire_TimeHms {
  uint8_t hours;
  uint8_t minutes;
  uint8_t seconds;
  uint32_t nano;
} wire_TimeHms;

typedef struct wire_UtcOffsetHms {
  int8_t hours;
  int8_t minutes;
  int8_t seconds;
} wire_UtcOffsetHms;

typedef struct wire_TimeOffset {
  struct wire_TimeHms time;
  struct wire_UtcOffsetHms offset;
} wire_TimeOffset;

typedef struct wire_DateAndOrTime_Time {
  struct wire_TimeOffset *field0;
} wire_DateAndOrTime_Time;

typedef union DateAndOrTimeKind {
  struct wire_DateAndOrTime_Date *Date;
  struct wire_DateAndOrTime_DateTime *DateTime;
  struct wire_DateAndOrTime_Time *Time;
} DateAndOrTimeKind;

typedef struct wire_DateAndOrTime {
  int32_t tag;
  union DateAndOrTimeKind *kind;
} wire_DateAndOrTime;

typedef struct wire_list_date_and_or_time {
  struct wire_DateAndOrTime *ptr;
  int32_t len;
} wire_list_date_and_or_time;

typedef struct wire_DateAndOrTimeProperty {
  struct wire_uint_8_list *group;
  struct wire_list_date_and_or_time *value;
  struct wire_Parameters *parameters;
} wire_DateAndOrTimeProperty;

typedef struct wire_DateTimeOrTextProperty_DateTime {
  struct wire_DateAndOrTimeProperty *field0;
} wire_DateTimeOrTextProperty_DateTime;

typedef struct wire_DateTimeOrTextProperty_Text {
  struct wire_TextProperty *field0;
} wire_DateTimeOrTextProperty_Text;

typedef union DateTimeOrTextPropertyKind {
  struct wire_DateTimeOrTextProperty_DateTime *DateTime;
  struct wire_DateTimeOrTextProperty_Text *Text;
} DateTimeOrTextPropertyKind;

typedef struct wire_DateTimeOrTextProperty {
  int32_t tag;
  union DateTimeOrTextPropertyKind *kind;
} wire_DateTimeOrTextProperty;

typedef struct wire_Gender {
  int32_t sex;
  struct wire_uint_8_list *identity;
} wire_Gender;

typedef struct wire_GenderProperty {
  struct wire_uint_8_list *group;
  struct wire_Gender value;
  struct wire_Parameters *parameters;
} wire_GenderProperty;

typedef struct wire_DeliveryAddress {
  struct wire_uint_8_list *po_box;
  struct wire_uint_8_list *extended_address;
  struct wire_uint_8_list *street_address;
  struct wire_uint_8_list *locality;
  struct wire_uint_8_list *region;
  struct wire_uint_8_list *postal_code;
  struct wire_uint_8_list *country_name;
} wire_DeliveryAddress;

typedef struct wire_AddressProperty {
  struct wire_uint_8_list *group;
  struct wire_DeliveryAddress value;
  struct wire_Parameters *parameters;
} wire_AddressProperty;

typedef struct wire_list_address_property {
  struct wire_AddressProperty *ptr;
  int32_t len;
} wire_list_address_property;

typedef struct wire_LanguageProperty {
  struct wire_uint_8_list *group;
  struct wire_uint_8_list *value;
  struct wire_Parameters *parameters;
} wire_LanguageProperty;

typedef struct wire_list_language_property {
  struct wire_LanguageProperty *ptr;
  int32_t len;
} wire_list_language_property;

typedef struct wire_list_text_list_property {
  struct wire_TextListProperty *ptr;
  int32_t len;
} wire_list_text_list_property;

typedef struct wire_TimeZoneProperty_Text {
  struct wire_TextProperty *field0;
} wire_TimeZoneProperty_Text;

typedef struct wire_TimeZoneProperty_Uri {
  struct wire_UriProperty *field0;
} wire_TimeZoneProperty_Uri;

typedef struct wire_UtcOffsetProperty {
  struct wire_uint_8_list *group;
  struct wire_UtcOffsetHms value;
  struct wire_Parameters *parameters;
} wire_UtcOffsetProperty;

typedef struct wire_TimeZoneProperty_UtcOffset {
  struct wire_UtcOffsetProperty *field0;
} wire_TimeZoneProperty_UtcOffset;

typedef union TimeZonePropertyKind {
  struct wire_TimeZoneProperty_Text *Text;
  struct wire_TimeZoneProperty_Uri *Uri;
  struct wire_TimeZoneProperty_UtcOffset *UtcOffset;
} TimeZonePropertyKind;

typedef struct wire_TimeZoneProperty {
  int32_t tag;
  union TimeZonePropertyKind *kind;
} wire_TimeZoneProperty;

typedef struct wire_list_time_zone_property {
  struct wire_TimeZoneProperty *ptr;
  int32_t len;
} wire_list_time_zone_property;

typedef struct wire_DateTimeProperty {
  struct wire_uint_8_list *group;
  struct wire_uint_8_list *value;
  struct wire_Parameters *parameters;
} wire_DateTimeProperty;

typedef struct wire_ClientPidMap {
  uint64_t source;
  struct wire_uint_8_list *uri;
} wire_ClientPidMap;

typedef struct wire_ClientPidMapProperty {
  struct wire_uint_8_list *group;
  struct wire_ClientPidMap value;
  struct wire_Parameters *parameters;
} wire_ClientPidMapProperty;

typedef struct wire_list_client_pid_map_property {
  struct wire_ClientPidMapProperty *ptr;
  int32_t len;
} wire_list_client_pid_map_property;

typedef struct wire_AnyProperty_Text {
  struct wire_uint_8_list *field0;
} wire_AnyProperty_Text;

typedef struct wire_int_64_list {
  int64_t *ptr;
  int32_t len;
} wire_int_64_list;

typedef struct wire_AnyProperty_Integer {
  struct wire_int_64_list *field0;
} wire_AnyProperty_Integer;

typedef struct wire_float_64_list {
  double *ptr;
  int32_t len;
} wire_float_64_list;

typedef struct wire_AnyProperty_Float {
  struct wire_float_64_list *field0;
} wire_AnyProperty_Float;

typedef struct wire_AnyProperty_Boolean {
  bool field0;
} wire_AnyProperty_Boolean;

typedef struct wire_list_calendar_date {
  struct wire_CalendarDate *ptr;
  int32_t len;
} wire_list_calendar_date;

typedef struct wire_AnyProperty_Date {
  struct wire_list_calendar_date *field0;
} wire_AnyProperty_Date;

typedef struct wire_AnyProperty_DateTime {
  struct wire_StringList *field0;
} wire_AnyProperty_DateTime;

typedef struct wire_list_time_offset {
  struct wire_TimeOffset *ptr;
  int32_t len;
} wire_list_time_offset;

typedef struct wire_AnyProperty_Time {
  struct wire_list_time_offset *field0;
} wire_AnyProperty_Time;

typedef struct wire_AnyProperty_DateAndOrTime {
  struct wire_list_date_and_or_time *field0;
} wire_AnyProperty_DateAndOrTime;

typedef struct wire_AnyProperty_Timestamp {
  struct wire_StringList *field0;
} wire_AnyProperty_Timestamp;

typedef struct wire_AnyProperty_Uri {
  struct wire_uint_8_list *field0;
} wire_AnyProperty_Uri;

typedef struct wire_AnyProperty_UtcOffset {
  struct wire_UtcOffsetHms *field0;
} wire_AnyProperty_UtcOffset;

typedef struct wire_AnyProperty_Language {
  struct wire_uint_8_list *field0;
} wire_AnyProperty_Language;

typedef union AnyPropertyKind {
  struct wire_AnyProperty_Text *Text;
  struct wire_AnyProperty_Integer *Integer;
  struct wire_AnyProperty_Float *Float;
  struct wire_AnyProperty_Boolean *Boolean;
  struct wire_AnyProperty_Date *Date;
  struct wire_AnyProperty_DateTime *DateTime;
  struct wire_AnyProperty_Time *Time;
  struct wire_AnyProperty_DateAndOrTime *DateAndOrTime;
  struct wire_AnyProperty_Timestamp *Timestamp;
  struct wire_AnyProperty_Uri *Uri;
  struct wire_AnyProperty_UtcOffset *UtcOffset;
  struct wire_AnyProperty_Language *Language;
} AnyPropertyKind;

typedef struct wire_AnyProperty {
  int32_t tag;
  union AnyPropertyKind *kind;
} wire_AnyProperty;

typedef struct wire_ExtensionProperty {
  struct wire_uint_8_list *name;
  struct wire_uint_8_list *group;
  struct wire_AnyProperty *value;
  struct wire_Parameters *parameters;
} wire_ExtensionProperty;

typedef struct wire_list_extension_property {
  struct wire_ExtensionProperty *ptr;
  int32_t len;
} wire_list_extension_property;

typedef struct wire_Vcard {
  struct wire_list_uri_property *source;
  struct wire_KindProperty *kind;
  struct wire_list_text_property *xml;
  struct wire_list_text_property *formatted_name;
  struct wire_TextListProperty *name;
  struct wire_list_text_property *nickname;
  struct wire_list_text_or_uri_property *photo;
  struct wire_DateTimeOrTextProperty *bday;
  struct wire_DateTimeOrTextProperty *anniversary;
  struct wire_GenderProperty *gender;
  struct wire_list_uri_property *url;
  struct wire_list_address_property *address;
  struct wire_list_text_or_uri_property *tel;
  struct wire_list_text_property *email;
  struct wire_list_uri_property *impp;
  struct wire_list_language_property *lang;
  struct wire_list_text_property *title;
  struct wire_list_text_property *role;
  struct wire_list_uri_property *logo;
  struct wire_list_text_list_property *org;
  struct wire_list_uri_property *member;
  struct wire_list_text_or_uri_property *related;
  struct wire_list_time_zone_property *timezone;
  struct wire_list_uri_property *geo;
  struct wire_list_text_list_property *categories;
  struct wire_list_text_property *note;
  struct wire_TextProperty *prod_id;
  struct wire_DateTimeProperty *rev;
  struct wire_list_uri_property *sound;
  struct wire_TextOrUriProperty *uid;
  struct wire_list_client_pid_map_property *client_pid_map;
  struct wire_list_text_or_uri_property *key;
  struct wire_list_uri_property *fburl;
  struct wire_list_uri_property *cal_adr_uri;
  struct wire_list_uri_property *cal_uri;
  struct wire_list_extension_property *extensions;
} wire_Vcard;

typedef struct wire_Secret_Contact {
  struct wire_Vcard *vcard;
  struct wire_UserData *user_data;
} wire_Secret_Contact;

typedef struct wire_Secret_Identity {
  int32_t id_kind;
  struct wire_uint_8_list *number;
  struct wire_uint_8_list *issue_place;
  struct wire_uint_8_list *issue_date;
  struct wire_uint_8_list *expiry_date;
  struct wire_UserData *user_data;
} wire_Secret_Identity;

typedef struct wire_Secret_File {
  struct wire_uint_8_list *name;
  struct wire_uint_8_list *mime;
  struct wire_uint_8_list *buffer;
  struct wire_uint_8_list *checksum;
  bool external_storage;
  uint64_t size;
  struct wire_UserData *user_data;
  struct wire_uint_8_list *path;
} wire_Secret_File;

typedef struct wire_Secret_Pem {
  struct wire_uint_8_list *certificate;
  uintptr_t entries;
  struct wire_UserData *user_data;
} wire_Secret_Pem;

typedef struct wire_Credential {
  struct wire_uint_8_list *name;
  struct wire_uint_8_list *passphrase;
} wire_Credential;

typedef struct wire_list_credential {
  struct wire_Credential *ptr;
  int32_t len;
} wire_list_credential;

typedef struct wire_Secret_List {
  struct wire_list_credential *items;
  struct wire_UserData *user_data;
} wire_Secret_List;

typedef struct wire_Secret_Totp {
  uintptr_t digits;
  uint64_t step;
  struct wire_uint_8_list *issuer;
  struct wire_uint_8_list *account_name;
  struct wire_uint_8_list *url;
  struct wire_uint_8_list *secret_base32;
  struct wire_UserData *user_data;
} wire_Secret_Totp;

typedef struct wire_Secret_Card {
  struct wire_uint_8_list *number;
  struct wire_uint_8_list *expiry;
  struct wire_uint_8_list *cvv;
  struct wire_uint_8_list *name;
  struct wire_uint_8_list *atm_pin;
  struct wire_UserData *user_data;
} wire_Secret_Card;

typedef struct wire_Secret_Bank {
  struct wire_uint_8_list *number;
  struct wire_uint_8_list *routing;
  struct wire_uint_8_list *iban;
  struct wire_uint_8_list *swift;
  struct wire_uint_8_list *bic;
  struct wire_UserData *user_data;
} wire_Secret_Bank;

typedef struct wire_Secret_Link {
  struct wire_uint_8_list *url;
  struct wire_uint_8_list *label;
  struct wire_uint_8_list *title;
  struct wire_UserData *user_data;
} wire_Secret_Link;

typedef struct wire_Secret_Password {
  struct wire_uint_8_list *password;
  struct wire_uint_8_list *name;
  struct wire_UserData *user_data;
} wire_Secret_Password;

typedef union SecretKind {
  struct wire_Secret_Account *Account;
  struct wire_Secret_Note *Note;
  struct wire_Secret_Contact *Contact;
  struct wire_Secret_Identity *Identity;
  struct wire_Secret_File *File;
  struct wire_Secret_Pem *Pem;
  struct wire_Secret_List *List;
  struct wire_Secret_Totp *Totp;
  struct wire_Secret_Card *Card;
  struct wire_Secret_Bank *Bank;
  struct wire_Secret_Link *Link;
  struct wire_Secret_Password *Password;
} SecretKind;

typedef struct wire_Secret {
  int32_t tag;
  union SecretKind *kind;
} wire_Secret;

typedef struct wire_list_summary {
  struct wire_Summary *ptr;
  int32_t len;
} wire_list_summary;

typedef struct wire_RestoreOptions {
  struct wire_list_summary *selected;
  struct wire_uint_8_list *passphrase;
} wire_RestoreOptions;

typedef struct wire_ImportTarget {
  int32_t format;
  struct wire_uint_8_list *path;
  struct wire_uint_8_list *folder_name;
} wire_ImportTarget;

typedef struct wire_PasswordGenerator {
  uintptr_t count;
  uintptr_t length;
  int32_t generator;
} wire_PasswordGenerator;

typedef struct DartCObject *WireSyncReturn;

void store_dart_post_cobject(DartPostCObjectFnType ptr);

Dart_Handle get_dart_object(uintptr_t ptr);

void drop_dart_object(uintptr_t ptr);

uintptr_t new_dart_opaque(Dart_Handle handle);

intptr_t init_frb_dart_api_dl(void *obj);

void wire_start_network(int64_t port_, struct wire_uint_8_list *location);

void wire_monitor_network(int64_t port_);

void wire_stop_network(int64_t port_);

void wire_restart_network(int64_t port_, struct wire_uint_8_list *location);

void wire_dial_peer(int64_t port_, struct wire_uint_8_list *addr);

void wire_register_namespaces(int64_t port_, struct wire_StringList *namespaces);

void wire_unregister_namespaces(int64_t port_, struct wire_StringList *namespaces);

void wire_discover_peers(int64_t port_, struct wire_uint_8_list *namespace_, uint64_t *limit);

void wire_net_device_info(int64_t port_, struct wire_uint_8_list *peer_id);

void wire_net_confirm_full_account(int64_t port_,
                                   struct wire_uint_8_list *peer_id,
                                   struct wire_uint_8_list *public_key,
                                   struct wire_uint_8_list *extra_info);

void wire_net_send_proof(int64_t port_,
                         struct wire_uint_8_list *peer_id,
                         struct wire_uint_8_list *proof);

void wire_net_request_entry(int64_t port_,
                            struct wire_uint_8_list *peer_id,
                            struct wire_uint_8_list *proof,
                            struct wire_uint_8_list *entry_id);

void wire_net_finish_sync(int64_t port_,
                          struct wire_uint_8_list *peer_id,
                          struct wire_uint_8_list *proof);

void wire_net_add_device_public_key(int64_t port_,
                                    struct wire_uint_8_list *peer_id,
                                    struct wire_uint_8_list *proof,
                                    struct wire_TrustedDevice *device);

void wire_prepare(int64_t port_,
                  struct wire_uint_8_list *path,
                  struct wire_uint_8_list *device_info);

void wire_sign_up(int64_t port_,
                  struct wire_uint_8_list *account_name,
                  struct wire_uint_8_list *passphrase);

void wire_sign_in(int64_t port_,
                  struct wire_uint_8_list *address,
                  struct wire_uint_8_list *passphrase);

void wire_load_devices(int64_t port_);

void wire_add_device(int64_t port_, struct wire_TrustedDevice *device);

void wire_remove_device(int64_t port_, struct wire_TrustedDevice *device);

void wire_load_account_data(int64_t port_);

void wire_document_exists_in_folder(int64_t port_,
                                    struct wire_uint_8_list *vault_id,
                                    struct wire_uint_8_list *label,
                                    struct wire_uint_8_list *id);

void wire_load_document_count(int64_t port_);

void wire_sign_out(int64_t port_);

void wire_list_vaults(int64_t port_);

void wire_load_documents(int64_t port_,
                         struct wire_list_document_view *views,
                         struct wire_ArchiveFilter *archive);

void wire_query_map(int64_t port_, struct wire_uint_8_list *query, struct wire_QueryFilter *filter);

void wire_rename_folder(int64_t port_, struct wire_Summary *summary, struct wire_uint_8_list *name);

void wire_create_folder(int64_t port_, struct wire_uint_8_list *name);

void wire_delete_folder(int64_t port_, struct wire_Summary *summary);

void wire_export_folder(int64_t port_,
                        struct wire_uint_8_list *path,
                        struct wire_Summary *summary,
                        struct wire_uint_8_list *new_passphrase,
                        bool save_passphrase);

void wire_import_folder(int64_t port_,
                        struct wire_uint_8_list *path,
                        struct wire_uint_8_list *passphrase,
                        bool overwrite);

void wire_verify(int64_t port_, struct wire_uint_8_list *passphrase);

void wire_verify_vault_buffer(int64_t port_,
                              struct wire_uint_8_list *buffer,
                              struct wire_uint_8_list *passphrase);

void wire_file_location(int64_t port_,
                        struct wire_uint_8_list *vault_id,
                        struct wire_uint_8_list *secret_id,
                        struct wire_uint_8_list *file_name);

void wire_decrypt_file_storage(int64_t port_,
                               struct wire_uint_8_list *vault_id,
                               struct wire_uint_8_list *secret_id,
                               struct wire_uint_8_list *file_name);

void wire_create_secret(int64_t port_,
                        struct wire_Summary *summary,
                        struct wire_SecretMeta *meta,
                        struct wire_Secret *secret);

void wire_read_secret(int64_t port_, struct wire_Summary *summary, struct wire_uint_8_list *id);

void wire_update_secret(int64_t port_,
                        struct wire_Summary *summary,
                        struct wire_uint_8_list *id,
                        struct wire_SecretMeta *meta,
                        struct wire_Secret *secret,
                        struct wire_Summary *destination);

void wire_move_secret(int64_t port_,
                      struct wire_Summary *from,
                      struct wire_Summary *to,
                      struct wire_uint_8_list *id);

void wire_delete_secret(int64_t port_, struct wire_Summary *summary, struct wire_uint_8_list *id);

void wire_archive_secret(int64_t port_, struct wire_Summary *from, struct wire_uint_8_list *id);

void wire_unarchive_secret(int64_t port_,
                           struct wire_Summary *from,
                           struct wire_uint_8_list *id,
                           struct wire_SecretMeta *meta);

void wire_guess_mime(int64_t port_, struct wire_uint_8_list *path);

void wire_get_qr_image(int64_t port_, struct wire_uint_8_list *value);

void wire_get_totp_state(int64_t port_, struct wire_uint_8_list *url);

void wire_get_totp_secret_by_uri(int64_t port_, struct wire_uint_8_list *uri);

void wire_export_archive_file(int64_t port_, struct wire_uint_8_list *path);

void wire_restore_archive_inventory(int64_t port_, struct wire_uint_8_list *buffer);

void wire_restore_archive_file(int64_t port_,
                               struct wire_uint_8_list *path,
                               struct wire_RestoreOptions *options);

void wire_restore_archive_buffer(int64_t port_,
                                 struct wire_uint_8_list *buffer,
                                 struct wire_RestoreOptions *options);

void wire_read_vault_summary(int64_t port_, struct wire_uint_8_list *path);

void wire_delete_account(int64_t port_);

void wire_rename_account(int64_t port_, struct wire_uint_8_list *name);

void wire_import_vcard_file(int64_t port_,
                            struct wire_uint_8_list *path,
                            struct wire_Summary *summary);

void wire_import_vcard(int64_t port_,
                       struct wire_uint_8_list *content,
                       struct wire_Summary *summary);

void wire_export_vcard_file(int64_t port_,
                            struct wire_uint_8_list *path,
                            struct wire_Summary *summary,
                            struct wire_uint_8_list *id);

void wire_export_all_vcards(int64_t port_, struct wire_uint_8_list *path);

void wire_load_avatar(int64_t port_, struct wire_Summary *summary, struct wire_uint_8_list *id);

void wire_export_unsafe_archive(int64_t port_, struct wire_uint_8_list *path);

void wire_import_file(int64_t port_, struct wire_ImportTarget *target);

void wire_measure_entropy(int64_t port_,
                          struct wire_uint_8_list *password,
                          struct wire_StringList *user_inputs);

void wire_generate_passphrase(int64_t port_, uintptr_t words);

void wire_generate_passwords(int64_t port_, struct wire_PasswordGenerator *options);

void wire_validate_web_url(int64_t port_, struct wire_uint_8_list *url);

void wire_validate_peer_uri(int64_t port_, struct wire_uint_8_list *uri);

void wire_validate_rendezvous_uri(int64_t port_, struct wire_uint_8_list *uri);

struct wire_StringList *new_StringList_0(int32_t len);

struct wire_AnyProperty *new_box_autoadd_any_property_0(void);

struct wire_ArchiveFilter *new_box_autoadd_archive_filter_0(void);

struct wire_CalendarDate *new_box_autoadd_calendar_date_0(void);

struct wire_DateAndOrTimeProperty *new_box_autoadd_date_and_or_time_property_0(void);

struct wire_DateTimeOrTextProperty *new_box_autoadd_date_time_or_text_property_0(void);

struct wire_DateTimeProperty *new_box_autoadd_date_time_property_0(void);

struct wire_GenderProperty *new_box_autoadd_gender_property_0(void);

struct wire_ImportTarget *new_box_autoadd_import_target_0(void);

struct wire_KindProperty *new_box_autoadd_kind_property_0(void);

struct wire_Parameters *new_box_autoadd_parameters_0(void);

struct wire_PasswordGenerator *new_box_autoadd_password_generator_0(void);

struct wire_QueryFilter *new_box_autoadd_query_filter_0(void);

struct wire_RestoreOptions *new_box_autoadd_restore_options_0(void);

struct wire_Secret *new_box_autoadd_secret_0(void);

struct wire_SecretMeta *new_box_autoadd_secret_meta_0(void);

struct wire_Summary *new_box_autoadd_summary_0(void);

struct wire_TextListProperty *new_box_autoadd_text_list_property_0(void);

struct wire_TextOrUriProperty *new_box_autoadd_text_or_uri_property_0(void);

struct wire_TextProperty *new_box_autoadd_text_property_0(void);

struct wire_TimeOffset *new_box_autoadd_time_offset_0(void);

struct wire_TimeZoneParameter *new_box_autoadd_time_zone_parameter_0(void);

struct wire_TrustedDevice *new_box_autoadd_trusted_device_0(void);

uint64_t *new_box_autoadd_u64_0(uint64_t value);

uint8_t *new_box_autoadd_u8_0(uint8_t value);

struct wire_UriProperty *new_box_autoadd_uri_property_0(void);

struct wire_UserData *new_box_autoadd_user_data_0(void);

struct wire_UtcOffsetHms *new_box_autoadd_utc_offset_hms_0(void);

struct wire_UtcOffsetProperty *new_box_autoadd_utc_offset_property_0(void);

int32_t *new_box_autoadd_value_type_0(int32_t value);

struct wire_Vcard *new_box_autoadd_vcard_0(void);

struct wire_float_64_list *new_float_64_list_0(int32_t len);

struct wire_int_64_list *new_int_64_list_0(int32_t len);

struct wire_list_address_property *new_list_address_property_0(int32_t len);

struct wire_list_calendar_date *new_list_calendar_date_0(int32_t len);

struct wire_list_client_pid_map_property *new_list_client_pid_map_property_0(int32_t len);

struct wire_list_credential *new_list_credential_0(int32_t len);

struct wire_list_date_and_or_time *new_list_date_and_or_time_0(int32_t len);

struct wire_list_document_view *new_list_document_view_0(int32_t len);

struct wire_list_extension *new_list_extension_0(int32_t len);

struct wire_list_extension_property *new_list_extension_property_0(int32_t len);

struct wire_list_kind *new_list_kind_0(int32_t len);

struct wire_list_language_property *new_list_language_property_0(int32_t len);

struct wire_list_pid *new_list_pid_0(int32_t len);

struct wire_list_secret_row *new_list_secret_row_0(int32_t len);

struct wire_list_secret_type *new_list_secret_type_0(int32_t len);

struct wire_list_summary *new_list_summary_0(int32_t len);

struct wire_list_text_list_property *new_list_text_list_property_0(int32_t len);

struct wire_list_text_or_uri_property *new_list_text_or_uri_property_0(int32_t len);

struct wire_list_text_property *new_list_text_property_0(int32_t len);

struct wire_list_time_offset *new_list_time_offset_0(int32_t len);

struct wire_list_time_zone_property *new_list_time_zone_property_0(int32_t len);

struct wire_list_type_parameter *new_list_type_parameter_0(int32_t len);

struct wire_list_uri_property *new_list_uri_property_0(int32_t len);

struct wire_uint_8_list *new_uint_8_list_0(int32_t len);

union AnyPropertyKind *inflate_AnyProperty_Text(void);

union AnyPropertyKind *inflate_AnyProperty_Integer(void);

union AnyPropertyKind *inflate_AnyProperty_Float(void);

union AnyPropertyKind *inflate_AnyProperty_Boolean(void);

union AnyPropertyKind *inflate_AnyProperty_Date(void);

union AnyPropertyKind *inflate_AnyProperty_DateTime(void);

union AnyPropertyKind *inflate_AnyProperty_Time(void);

union AnyPropertyKind *inflate_AnyProperty_DateAndOrTime(void);

union AnyPropertyKind *inflate_AnyProperty_Timestamp(void);

union AnyPropertyKind *inflate_AnyProperty_Uri(void);

union AnyPropertyKind *inflate_AnyProperty_UtcOffset(void);

union AnyPropertyKind *inflate_AnyProperty_Language(void);

union DateAndOrTimeKind *inflate_DateAndOrTime_Date(void);

union DateAndOrTimeKind *inflate_DateAndOrTime_DateTime(void);

union DateAndOrTimeKind *inflate_DateAndOrTime_Time(void);

union DateTimeOrTextPropertyKind *inflate_DateTimeOrTextProperty_DateTime(void);

union DateTimeOrTextPropertyKind *inflate_DateTimeOrTextProperty_Text(void);

union DocumentViewKind *inflate_DocumentView_All(void);

union DocumentViewKind *inflate_DocumentView_Vault(void);

union DocumentViewKind *inflate_DocumentView_TypeId(void);

union DocumentViewKind *inflate_DocumentView_Tags(void);

union DocumentViewKind *inflate_DocumentView_Contact(void);

union DocumentViewKind *inflate_DocumentView_Documents(void);

union SecretKind *inflate_Secret_Account(void);

union SecretKind *inflate_Secret_Note(void);

union SecretKind *inflate_Secret_Contact(void);

union SecretKind *inflate_Secret_Identity(void);

union SecretKind *inflate_Secret_File(void);

union SecretKind *inflate_Secret_Pem(void);

union SecretKind *inflate_Secret_List(void);

union SecretKind *inflate_Secret_Totp(void);

union SecretKind *inflate_Secret_Card(void);

union SecretKind *inflate_Secret_Bank(void);

union SecretKind *inflate_Secret_Link(void);

union SecretKind *inflate_Secret_Password(void);

union TextOrUriPropertyKind *inflate_TextOrUriProperty_Text(void);

union TextOrUriPropertyKind *inflate_TextOrUriProperty_Uri(void);

union TimeZoneParameterKind *inflate_TimeZoneParameter_Text(void);

union TimeZoneParameterKind *inflate_TimeZoneParameter_Uri(void);

union TimeZoneParameterKind *inflate_TimeZoneParameter_UtcOffset(void);

union TimeZonePropertyKind *inflate_TimeZoneProperty_Text(void);

union TimeZonePropertyKind *inflate_TimeZoneProperty_Uri(void);

union TimeZonePropertyKind *inflate_TimeZoneProperty_UtcOffset(void);

union TypeParameterKind *inflate_TypeParameter_Telephone(void);

union TypeParameterKind *inflate_TypeParameter_Related(void);

union TypeParameterKind *inflate_TypeParameter_Extension(void);

void free_WireSyncReturn(WireSyncReturn ptr);

static int64_t dummy_method_to_enforce_bundling(void) {
    int64_t dummy_var = 0;
    dummy_var ^= ((int64_t) (void*) wire_start_network);
    dummy_var ^= ((int64_t) (void*) wire_monitor_network);
    dummy_var ^= ((int64_t) (void*) wire_stop_network);
    dummy_var ^= ((int64_t) (void*) wire_restart_network);
    dummy_var ^= ((int64_t) (void*) wire_dial_peer);
    dummy_var ^= ((int64_t) (void*) wire_register_namespaces);
    dummy_var ^= ((int64_t) (void*) wire_unregister_namespaces);
    dummy_var ^= ((int64_t) (void*) wire_discover_peers);
    dummy_var ^= ((int64_t) (void*) wire_net_device_info);
    dummy_var ^= ((int64_t) (void*) wire_net_confirm_full_account);
    dummy_var ^= ((int64_t) (void*) wire_net_send_proof);
    dummy_var ^= ((int64_t) (void*) wire_net_request_entry);
    dummy_var ^= ((int64_t) (void*) wire_net_finish_sync);
    dummy_var ^= ((int64_t) (void*) wire_net_add_device_public_key);
    dummy_var ^= ((int64_t) (void*) wire_prepare);
    dummy_var ^= ((int64_t) (void*) wire_sign_up);
    dummy_var ^= ((int64_t) (void*) wire_sign_in);
    dummy_var ^= ((int64_t) (void*) wire_load_devices);
    dummy_var ^= ((int64_t) (void*) wire_add_device);
    dummy_var ^= ((int64_t) (void*) wire_remove_device);
    dummy_var ^= ((int64_t) (void*) wire_load_account_data);
    dummy_var ^= ((int64_t) (void*) wire_document_exists_in_folder);
    dummy_var ^= ((int64_t) (void*) wire_load_document_count);
    dummy_var ^= ((int64_t) (void*) wire_sign_out);
    dummy_var ^= ((int64_t) (void*) wire_list_vaults);
    dummy_var ^= ((int64_t) (void*) wire_load_documents);
    dummy_var ^= ((int64_t) (void*) wire_query_map);
    dummy_var ^= ((int64_t) (void*) wire_rename_folder);
    dummy_var ^= ((int64_t) (void*) wire_create_folder);
    dummy_var ^= ((int64_t) (void*) wire_delete_folder);
    dummy_var ^= ((int64_t) (void*) wire_export_folder);
    dummy_var ^= ((int64_t) (void*) wire_import_folder);
    dummy_var ^= ((int64_t) (void*) wire_verify);
    dummy_var ^= ((int64_t) (void*) wire_verify_vault_buffer);
    dummy_var ^= ((int64_t) (void*) wire_file_location);
    dummy_var ^= ((int64_t) (void*) wire_decrypt_file_storage);
    dummy_var ^= ((int64_t) (void*) wire_create_secret);
    dummy_var ^= ((int64_t) (void*) wire_read_secret);
    dummy_var ^= ((int64_t) (void*) wire_update_secret);
    dummy_var ^= ((int64_t) (void*) wire_move_secret);
    dummy_var ^= ((int64_t) (void*) wire_delete_secret);
    dummy_var ^= ((int64_t) (void*) wire_archive_secret);
    dummy_var ^= ((int64_t) (void*) wire_unarchive_secret);
    dummy_var ^= ((int64_t) (void*) wire_guess_mime);
    dummy_var ^= ((int64_t) (void*) wire_get_qr_image);
    dummy_var ^= ((int64_t) (void*) wire_get_totp_state);
    dummy_var ^= ((int64_t) (void*) wire_get_totp_secret_by_uri);
    dummy_var ^= ((int64_t) (void*) wire_export_archive_file);
    dummy_var ^= ((int64_t) (void*) wire_restore_archive_inventory);
    dummy_var ^= ((int64_t) (void*) wire_restore_archive_file);
    dummy_var ^= ((int64_t) (void*) wire_restore_archive_buffer);
    dummy_var ^= ((int64_t) (void*) wire_read_vault_summary);
    dummy_var ^= ((int64_t) (void*) wire_delete_account);
    dummy_var ^= ((int64_t) (void*) wire_rename_account);
    dummy_var ^= ((int64_t) (void*) wire_import_vcard_file);
    dummy_var ^= ((int64_t) (void*) wire_import_vcard);
    dummy_var ^= ((int64_t) (void*) wire_export_vcard_file);
    dummy_var ^= ((int64_t) (void*) wire_export_all_vcards);
    dummy_var ^= ((int64_t) (void*) wire_load_avatar);
    dummy_var ^= ((int64_t) (void*) wire_export_unsafe_archive);
    dummy_var ^= ((int64_t) (void*) wire_import_file);
    dummy_var ^= ((int64_t) (void*) wire_measure_entropy);
    dummy_var ^= ((int64_t) (void*) wire_generate_passphrase);
    dummy_var ^= ((int64_t) (void*) wire_generate_passwords);
    dummy_var ^= ((int64_t) (void*) wire_validate_web_url);
    dummy_var ^= ((int64_t) (void*) wire_validate_peer_uri);
    dummy_var ^= ((int64_t) (void*) wire_validate_rendezvous_uri);
    dummy_var ^= ((int64_t) (void*) new_StringList_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_any_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_archive_filter_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_calendar_date_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_date_and_or_time_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_date_time_or_text_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_date_time_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_gender_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_import_target_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_kind_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_parameters_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_password_generator_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_query_filter_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_restore_options_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_secret_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_secret_meta_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_summary_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_text_list_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_text_or_uri_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_text_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_time_offset_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_time_zone_parameter_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_trusted_device_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_u64_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_u8_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_uri_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_user_data_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_utc_offset_hms_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_utc_offset_property_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_value_type_0);
    dummy_var ^= ((int64_t) (void*) new_box_autoadd_vcard_0);
    dummy_var ^= ((int64_t) (void*) new_float_64_list_0);
    dummy_var ^= ((int64_t) (void*) new_int_64_list_0);
    dummy_var ^= ((int64_t) (void*) new_list_address_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_calendar_date_0);
    dummy_var ^= ((int64_t) (void*) new_list_client_pid_map_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_credential_0);
    dummy_var ^= ((int64_t) (void*) new_list_date_and_or_time_0);
    dummy_var ^= ((int64_t) (void*) new_list_document_view_0);
    dummy_var ^= ((int64_t) (void*) new_list_extension_0);
    dummy_var ^= ((int64_t) (void*) new_list_extension_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_kind_0);
    dummy_var ^= ((int64_t) (void*) new_list_language_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_pid_0);
    dummy_var ^= ((int64_t) (void*) new_list_secret_row_0);
    dummy_var ^= ((int64_t) (void*) new_list_secret_type_0);
    dummy_var ^= ((int64_t) (void*) new_list_summary_0);
    dummy_var ^= ((int64_t) (void*) new_list_text_list_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_text_or_uri_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_text_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_time_offset_0);
    dummy_var ^= ((int64_t) (void*) new_list_time_zone_property_0);
    dummy_var ^= ((int64_t) (void*) new_list_type_parameter_0);
    dummy_var ^= ((int64_t) (void*) new_list_uri_property_0);
    dummy_var ^= ((int64_t) (void*) new_uint_8_list_0);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Text);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Integer);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Float);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Boolean);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Date);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_DateTime);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Time);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_DateAndOrTime);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Timestamp);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Uri);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_UtcOffset);
    dummy_var ^= ((int64_t) (void*) inflate_AnyProperty_Language);
    dummy_var ^= ((int64_t) (void*) inflate_DateAndOrTime_Date);
    dummy_var ^= ((int64_t) (void*) inflate_DateAndOrTime_DateTime);
    dummy_var ^= ((int64_t) (void*) inflate_DateAndOrTime_Time);
    dummy_var ^= ((int64_t) (void*) inflate_DateTimeOrTextProperty_DateTime);
    dummy_var ^= ((int64_t) (void*) inflate_DateTimeOrTextProperty_Text);
    dummy_var ^= ((int64_t) (void*) inflate_DocumentView_All);
    dummy_var ^= ((int64_t) (void*) inflate_DocumentView_Vault);
    dummy_var ^= ((int64_t) (void*) inflate_DocumentView_TypeId);
    dummy_var ^= ((int64_t) (void*) inflate_DocumentView_Tags);
    dummy_var ^= ((int64_t) (void*) inflate_DocumentView_Contact);
    dummy_var ^= ((int64_t) (void*) inflate_DocumentView_Documents);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Account);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Note);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Contact);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Identity);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_File);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Pem);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_List);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Totp);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Card);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Bank);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Link);
    dummy_var ^= ((int64_t) (void*) inflate_Secret_Password);
    dummy_var ^= ((int64_t) (void*) inflate_TextOrUriProperty_Text);
    dummy_var ^= ((int64_t) (void*) inflate_TextOrUriProperty_Uri);
    dummy_var ^= ((int64_t) (void*) inflate_TimeZoneParameter_Text);
    dummy_var ^= ((int64_t) (void*) inflate_TimeZoneParameter_Uri);
    dummy_var ^= ((int64_t) (void*) inflate_TimeZoneParameter_UtcOffset);
    dummy_var ^= ((int64_t) (void*) inflate_TimeZoneProperty_Text);
    dummy_var ^= ((int64_t) (void*) inflate_TimeZoneProperty_Uri);
    dummy_var ^= ((int64_t) (void*) inflate_TimeZoneProperty_UtcOffset);
    dummy_var ^= ((int64_t) (void*) inflate_TypeParameter_Telephone);
    dummy_var ^= ((int64_t) (void*) inflate_TypeParameter_Related);
    dummy_var ^= ((int64_t) (void*) inflate_TypeParameter_Extension);
    dummy_var ^= ((int64_t) (void*) free_WireSyncReturn);
    dummy_var ^= ((int64_t) (void*) store_dart_post_cobject);
    dummy_var ^= ((int64_t) (void*) get_dart_object);
    dummy_var ^= ((int64_t) (void*) drop_dart_object);
    dummy_var ^= ((int64_t) (void*) new_dart_opaque);
    return dummy_var;
}

This is the generated rust file that is being used to creating the bindings:

use super::*;
// Section: wire functions

#[no_mangle]
pub extern "C" fn wire_start_network(
    port_: i64,
    location: *mut wire_uint_8_list,
) {
    wire_start_network_impl(port_, location)
}

#[no_mangle]
pub extern "C" fn wire_monitor_network(port_: i64) {
    wire_monitor_network_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_stop_network(port_: i64) {
    wire_stop_network_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_restart_network(
    port_: i64,
    location: *mut wire_uint_8_list,
) {
    wire_restart_network_impl(port_, location)
}

#[no_mangle]
pub extern "C" fn wire_dial_peer(port_: i64, addr: *mut wire_uint_8_list) {
    wire_dial_peer_impl(port_, addr)
}

#[no_mangle]
pub extern "C" fn wire_register_namespaces(
    port_: i64,
    namespaces: *mut wire_StringList,
) {
    wire_register_namespaces_impl(port_, namespaces)
}

#[no_mangle]
pub extern "C" fn wire_unregister_namespaces(
    port_: i64,
    namespaces: *mut wire_StringList,
) {
    wire_unregister_namespaces_impl(port_, namespaces)
}

#[no_mangle]
pub extern "C" fn wire_discover_peers(
    port_: i64,
    namespace: *mut wire_uint_8_list,
    limit: *mut u64,
) {
    wire_discover_peers_impl(port_, namespace, limit)
}

#[no_mangle]
pub extern "C" fn wire_net_device_info(
    port_: i64,
    peer_id: *mut wire_uint_8_list,
) {
    wire_net_device_info_impl(port_, peer_id)
}

#[no_mangle]
pub extern "C" fn wire_net_confirm_full_account(
    port_: i64,
    peer_id: *mut wire_uint_8_list,
    public_key: *mut wire_uint_8_list,
    extra_info: *mut wire_uint_8_list,
) {
    wire_net_confirm_full_account_impl(port_, peer_id, public_key, extra_info)
}

#[no_mangle]
pub extern "C" fn wire_net_send_proof(
    port_: i64,
    peer_id: *mut wire_uint_8_list,
    proof: *mut wire_uint_8_list,
) {
    wire_net_send_proof_impl(port_, peer_id, proof)
}

#[no_mangle]
pub extern "C" fn wire_net_request_entry(
    port_: i64,
    peer_id: *mut wire_uint_8_list,
    proof: *mut wire_uint_8_list,
    entry_id: *mut wire_uint_8_list,
) {
    wire_net_request_entry_impl(port_, peer_id, proof, entry_id)
}

#[no_mangle]
pub extern "C" fn wire_net_finish_sync(
    port_: i64,
    peer_id: *mut wire_uint_8_list,
    proof: *mut wire_uint_8_list,
) {
    wire_net_finish_sync_impl(port_, peer_id, proof)
}

#[no_mangle]
pub extern "C" fn wire_net_add_device_public_key(
    port_: i64,
    peer_id: *mut wire_uint_8_list,
    proof: *mut wire_uint_8_list,
    device: *mut wire_TrustedDevice,
) {
    wire_net_add_device_public_key_impl(port_, peer_id, proof, device)
}

#[no_mangle]
pub extern "C" fn wire_prepare(
    port_: i64,
    path: *mut wire_uint_8_list,
    device_info: *mut wire_uint_8_list,
) {
    wire_prepare_impl(port_, path, device_info)
}

#[no_mangle]
pub extern "C" fn wire_sign_up(
    port_: i64,
    account_name: *mut wire_uint_8_list,
    passphrase: *mut wire_uint_8_list,
) {
    wire_sign_up_impl(port_, account_name, passphrase)
}

#[no_mangle]
pub extern "C" fn wire_sign_in(
    port_: i64,
    address: *mut wire_uint_8_list,
    passphrase: *mut wire_uint_8_list,
) {
    wire_sign_in_impl(port_, address, passphrase)
}

#[no_mangle]
pub extern "C" fn wire_load_devices(port_: i64) {
    wire_load_devices_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_add_device(
    port_: i64,
    device: *mut wire_TrustedDevice,
) {
    wire_add_device_impl(port_, device)
}

#[no_mangle]
pub extern "C" fn wire_remove_device(
    port_: i64,
    device: *mut wire_TrustedDevice,
) {
    wire_remove_device_impl(port_, device)
}

#[no_mangle]
pub extern "C" fn wire_load_account_data(port_: i64) {
    wire_load_account_data_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_document_exists_in_folder(
    port_: i64,
    vault_id: *mut wire_uint_8_list,
    label: *mut wire_uint_8_list,
    id: *mut wire_uint_8_list,
) {
    wire_document_exists_in_folder_impl(port_, vault_id, label, id)
}

#[no_mangle]
pub extern "C" fn wire_load_document_count(port_: i64) {
    wire_load_document_count_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_sign_out(port_: i64) {
    wire_sign_out_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_list_vaults(port_: i64) {
    wire_list_vaults_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_load_documents(
    port_: i64,
    views: *mut wire_list_document_view,
    archive: *mut wire_ArchiveFilter,
) {
    wire_load_documents_impl(port_, views, archive)
}

#[no_mangle]
pub extern "C" fn wire_query_map(
    port_: i64,
    query: *mut wire_uint_8_list,
    filter: *mut wire_QueryFilter,
) {
    wire_query_map_impl(port_, query, filter)
}

#[no_mangle]
pub extern "C" fn wire_rename_folder(
    port_: i64,
    summary: *mut wire_Summary,
    name: *mut wire_uint_8_list,
) {
    wire_rename_folder_impl(port_, summary, name)
}

#[no_mangle]
pub extern "C" fn wire_create_folder(
    port_: i64,
    name: *mut wire_uint_8_list,
) {
    wire_create_folder_impl(port_, name)
}

#[no_mangle]
pub extern "C" fn wire_delete_folder(port_: i64, summary: *mut wire_Summary) {
    wire_delete_folder_impl(port_, summary)
}

#[no_mangle]
pub extern "C" fn wire_export_folder(
    port_: i64,
    path: *mut wire_uint_8_list,
    summary: *mut wire_Summary,
    new_passphrase: *mut wire_uint_8_list,
    save_passphrase: bool,
) {
    wire_export_folder_impl(
        port_,
        path,
        summary,
        new_passphrase,
        save_passphrase,
    )
}

#[no_mangle]
pub extern "C" fn wire_import_folder(
    port_: i64,
    path: *mut wire_uint_8_list,
    passphrase: *mut wire_uint_8_list,
    overwrite: bool,
) {
    wire_import_folder_impl(port_, path, passphrase, overwrite)
}

#[no_mangle]
pub extern "C" fn wire_verify(port_: i64, passphrase: *mut wire_uint_8_list) {
    wire_verify_impl(port_, passphrase)
}

#[no_mangle]
pub extern "C" fn wire_verify_vault_buffer(
    port_: i64,
    buffer: *mut wire_uint_8_list,
    passphrase: *mut wire_uint_8_list,
) {
    wire_verify_vault_buffer_impl(port_, buffer, passphrase)
}

#[no_mangle]
pub extern "C" fn wire_file_location(
    port_: i64,
    vault_id: *mut wire_uint_8_list,
    secret_id: *mut wire_uint_8_list,
    file_name: *mut wire_uint_8_list,
) {
    wire_file_location_impl(port_, vault_id, secret_id, file_name)
}

#[no_mangle]
pub extern "C" fn wire_decrypt_file_storage(
    port_: i64,
    vault_id: *mut wire_uint_8_list,
    secret_id: *mut wire_uint_8_list,
    file_name: *mut wire_uint_8_list,
) {
    wire_decrypt_file_storage_impl(port_, vault_id, secret_id, file_name)
}

#[no_mangle]
pub extern "C" fn wire_create_secret(
    port_: i64,
    summary: *mut wire_Summary,
    meta: *mut wire_SecretMeta,
    secret: *mut wire_Secret,
) {
    wire_create_secret_impl(port_, summary, meta, secret)
}

#[no_mangle]
pub extern "C" fn wire_read_secret(
    port_: i64,
    summary: *mut wire_Summary,
    id: *mut wire_uint_8_list,
) {
    wire_read_secret_impl(port_, summary, id)
}

#[no_mangle]
pub extern "C" fn wire_update_secret(
    port_: i64,
    summary: *mut wire_Summary,
    id: *mut wire_uint_8_list,
    meta: *mut wire_SecretMeta,
    secret: *mut wire_Secret,
    destination: *mut wire_Summary,
) {
    wire_update_secret_impl(port_, summary, id, meta, secret, destination)
}

#[no_mangle]
pub extern "C" fn wire_move_secret(
    port_: i64,
    from: *mut wire_Summary,
    to: *mut wire_Summary,
    id: *mut wire_uint_8_list,
) {
    wire_move_secret_impl(port_, from, to, id)
}

#[no_mangle]
pub extern "C" fn wire_delete_secret(
    port_: i64,
    summary: *mut wire_Summary,
    id: *mut wire_uint_8_list,
) {
    wire_delete_secret_impl(port_, summary, id)
}

#[no_mangle]
pub extern "C" fn wire_archive_secret(
    port_: i64,
    from: *mut wire_Summary,
    id: *mut wire_uint_8_list,
) {
    wire_archive_secret_impl(port_, from, id)
}

#[no_mangle]
pub extern "C" fn wire_unarchive_secret(
    port_: i64,
    from: *mut wire_Summary,
    id: *mut wire_uint_8_list,
    meta: *mut wire_SecretMeta,
) {
    wire_unarchive_secret_impl(port_, from, id, meta)
}

#[no_mangle]
pub extern "C" fn wire_guess_mime(port_: i64, path: *mut wire_uint_8_list) {
    wire_guess_mime_impl(port_, path)
}

#[no_mangle]
pub extern "C" fn wire_get_qr_image(
    port_: i64,
    value: *mut wire_uint_8_list,
) {
    wire_get_qr_image_impl(port_, value)
}

#[no_mangle]
pub extern "C" fn wire_get_totp_state(
    port_: i64,
    url: *mut wire_uint_8_list,
) {
    wire_get_totp_state_impl(port_, url)
}

#[no_mangle]
pub extern "C" fn wire_get_totp_secret_by_uri(
    port_: i64,
    uri: *mut wire_uint_8_list,
) {
    wire_get_totp_secret_by_uri_impl(port_, uri)
}

#[no_mangle]
pub extern "C" fn wire_export_archive_file(
    port_: i64,
    path: *mut wire_uint_8_list,
) {
    wire_export_archive_file_impl(port_, path)
}

#[no_mangle]
pub extern "C" fn wire_restore_archive_inventory(
    port_: i64,
    buffer: *mut wire_uint_8_list,
) {
    wire_restore_archive_inventory_impl(port_, buffer)
}

#[no_mangle]
pub extern "C" fn wire_restore_archive_file(
    port_: i64,
    path: *mut wire_uint_8_list,
    options: *mut wire_RestoreOptions,
) {
    wire_restore_archive_file_impl(port_, path, options)
}

#[no_mangle]
pub extern "C" fn wire_restore_archive_buffer(
    port_: i64,
    buffer: *mut wire_uint_8_list,
    options: *mut wire_RestoreOptions,
) {
    wire_restore_archive_buffer_impl(port_, buffer, options)
}

#[no_mangle]
pub extern "C" fn wire_read_vault_summary(
    port_: i64,
    path: *mut wire_uint_8_list,
) {
    wire_read_vault_summary_impl(port_, path)
}

#[no_mangle]
pub extern "C" fn wire_delete_account(port_: i64) {
    wire_delete_account_impl(port_)
}

#[no_mangle]
pub extern "C" fn wire_rename_account(
    port_: i64,
    name: *mut wire_uint_8_list,
) {
    wire_rename_account_impl(port_, name)
}

#[no_mangle]
pub extern "C" fn wire_import_vcard_file(
    port_: i64,
    path: *mut wire_uint_8_list,
    summary: *mut wire_Summary,
) {
    wire_import_vcard_file_impl(port_, path, summary)
}

#[no_mangle]
pub extern "C" fn wire_import_vcard(
    port_: i64,
    content: *mut wire_uint_8_list,
    summary: *mut wire_Summary,
) {
    wire_import_vcard_impl(port_, content, summary)
}

#[no_mangle]
pub extern "C" fn wire_export_vcard_file(
    port_: i64,
    path: *mut wire_uint_8_list,
    summary: *mut wire_Summary,
    id: *mut wire_uint_8_list,
) {
    wire_export_vcard_file_impl(port_, path, summary, id)
}

#[no_mangle]
pub extern "C" fn wire_export_all_vcards(
    port_: i64,
    path: *mut wire_uint_8_list,
) {
    wire_export_all_vcards_impl(port_, path)
}

#[no_mangle]
pub extern "C" fn wire_load_avatar(
    port_: i64,
    summary: *mut wire_Summary,
    id: *mut wire_uint_8_list,
) {
    wire_load_avatar_impl(port_, summary, id)
}

#[no_mangle]
pub extern "C" fn wire_export_unsafe_archive(
    port_: i64,
    path: *mut wire_uint_8_list,
) {
    wire_export_unsafe_archive_impl(port_, path)
}

#[no_mangle]
pub extern "C" fn wire_import_file(
    port_: i64,
    target: *mut wire_ImportTarget,
) {
    wire_import_file_impl(port_, target)
}

#[no_mangle]
pub extern "C" fn wire_measure_entropy(
    port_: i64,
    password: *mut wire_uint_8_list,
    user_inputs: *mut wire_StringList,
) {
    wire_measure_entropy_impl(port_, password, user_inputs)
}

#[no_mangle]
pub extern "C" fn wire_generate_passphrase(port_: i64, words: usize) {
    wire_generate_passphrase_impl(port_, words)
}

#[no_mangle]
pub extern "C" fn wire_generate_passwords(
    port_: i64,
    options: *mut wire_PasswordGenerator,
) {
    wire_generate_passwords_impl(port_, options)
}

#[no_mangle]
pub extern "C" fn wire_validate_web_url(
    port_: i64,
    url: *mut wire_uint_8_list,
) {
    wire_validate_web_url_impl(port_, url)
}

#[no_mangle]
pub extern "C" fn wire_validate_peer_uri(
    port_: i64,
    uri: *mut wire_uint_8_list,
) {
    wire_validate_peer_uri_impl(port_, uri)
}

#[no_mangle]
pub extern "C" fn wire_validate_rendezvous_uri(
    port_: i64,
    uri: *mut wire_uint_8_list,
) {
    wire_validate_rendezvous_uri_impl(port_, uri)
}

// Section: allocate functions

#[no_mangle]
pub extern "C" fn new_StringList_0(len: i32) -> *mut wire_StringList {
    let wrap = wire_StringList {
        ptr: support::new_leak_vec_ptr(
            <*mut wire_uint_8_list>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_any_property_0() -> *mut wire_AnyProperty {
    support::new_leak_box_ptr(wire_AnyProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_archive_filter_0() -> *mut wire_ArchiveFilter
{
    support::new_leak_box_ptr(wire_ArchiveFilter::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_calendar_date_0() -> *mut wire_CalendarDate
{
    support::new_leak_box_ptr(wire_CalendarDate::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_date_and_or_time_property_0(
) -> *mut wire_DateAndOrTimeProperty {
    support::new_leak_box_ptr(wire_DateAndOrTimeProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_date_time_or_text_property_0(
) -> *mut wire_DateTimeOrTextProperty {
    support::new_leak_box_ptr(wire_DateTimeOrTextProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_date_time_property_0(
) -> *mut wire_DateTimeProperty {
    support::new_leak_box_ptr(wire_DateTimeProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_gender_property_0(
) -> *mut wire_GenderProperty {
    support::new_leak_box_ptr(wire_GenderProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_import_target_0() -> *mut wire_ImportTarget
{
    support::new_leak_box_ptr(wire_ImportTarget::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_kind_property_0() -> *mut wire_KindProperty
{
    support::new_leak_box_ptr(wire_KindProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_parameters_0() -> *mut wire_Parameters {
    support::new_leak_box_ptr(wire_Parameters::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_password_generator_0(
) -> *mut wire_PasswordGenerator {
    support::new_leak_box_ptr(wire_PasswordGenerator::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_query_filter_0() -> *mut wire_QueryFilter {
    support::new_leak_box_ptr(wire_QueryFilter::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_restore_options_0(
) -> *mut wire_RestoreOptions {
    support::new_leak_box_ptr(wire_RestoreOptions::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_secret_0() -> *mut wire_Secret {
    support::new_leak_box_ptr(wire_Secret::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_secret_meta_0() -> *mut wire_SecretMeta {
    support::new_leak_box_ptr(wire_SecretMeta::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_summary_0() -> *mut wire_Summary {
    support::new_leak_box_ptr(wire_Summary::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_text_list_property_0(
) -> *mut wire_TextListProperty {
    support::new_leak_box_ptr(wire_TextListProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_text_or_uri_property_0(
) -> *mut wire_TextOrUriProperty {
    support::new_leak_box_ptr(wire_TextOrUriProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_text_property_0() -> *mut wire_TextProperty
{
    support::new_leak_box_ptr(wire_TextProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_time_offset_0() -> *mut wire_TimeOffset {
    support::new_leak_box_ptr(wire_TimeOffset::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_time_zone_parameter_0(
) -> *mut wire_TimeZoneParameter {
    support::new_leak_box_ptr(wire_TimeZoneParameter::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_trusted_device_0() -> *mut wire_TrustedDevice
{
    support::new_leak_box_ptr(wire_TrustedDevice::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_u64_0(value: u64) -> *mut u64 {
    support::new_leak_box_ptr(value)
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_u8_0(value: u8) -> *mut u8 {
    support::new_leak_box_ptr(value)
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_uri_property_0() -> *mut wire_UriProperty {
    support::new_leak_box_ptr(wire_UriProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_user_data_0() -> *mut wire_UserData {
    support::new_leak_box_ptr(wire_UserData::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_utc_offset_hms_0() -> *mut wire_UtcOffsetHms
{
    support::new_leak_box_ptr(wire_UtcOffsetHms::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_utc_offset_property_0(
) -> *mut wire_UtcOffsetProperty {
    support::new_leak_box_ptr(wire_UtcOffsetProperty::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_value_type_0(value: i32) -> *mut i32 {
    support::new_leak_box_ptr(value)
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_vcard_0() -> *mut wire_Vcard {
    support::new_leak_box_ptr(wire_Vcard::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_float_64_list_0(len: i32) -> *mut wire_float_64_list {
    let ans = wire_float_64_list {
        ptr: support::new_leak_vec_ptr(Default::default(), len),
        len,
    };
    support::new_leak_box_ptr(ans)
}

#[no_mangle]
pub extern "C" fn new_int_64_list_0(len: i32) -> *mut wire_int_64_list {
    let ans = wire_int_64_list {
        ptr: support::new_leak_vec_ptr(Default::default(), len),
        len,
    };
    support::new_leak_box_ptr(ans)
}

#[no_mangle]
pub extern "C" fn new_list_address_property_0(
    len: i32,
) -> *mut wire_list_address_property {
    let wrap = wire_list_address_property {
        ptr: support::new_leak_vec_ptr(
            <wire_AddressProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_calendar_date_0(
    len: i32,
) -> *mut wire_list_calendar_date {
    let wrap = wire_list_calendar_date {
        ptr: support::new_leak_vec_ptr(
            <wire_CalendarDate>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_client_pid_map_property_0(
    len: i32,
) -> *mut wire_list_client_pid_map_property {
    let wrap = wire_list_client_pid_map_property {
        ptr: support::new_leak_vec_ptr(
            <wire_ClientPidMapProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_credential_0(
    len: i32,
) -> *mut wire_list_credential {
    let wrap = wire_list_credential {
        ptr: support::new_leak_vec_ptr(
            <wire_Credential>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_date_and_or_time_0(
    len: i32,
) -> *mut wire_list_date_and_or_time {
    let wrap = wire_list_date_and_or_time {
        ptr: support::new_leak_vec_ptr(
            <wire_DateAndOrTime>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_document_view_0(
    len: i32,
) -> *mut wire_list_document_view {
    let wrap = wire_list_document_view {
        ptr: support::new_leak_vec_ptr(
            <wire_DocumentView>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_extension_0(len: i32) -> *mut wire_list_extension {
    let wrap = wire_list_extension {
        ptr: support::new_leak_vec_ptr(
            <wire_Extension>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_extension_property_0(
    len: i32,
) -> *mut wire_list_extension_property {
    let wrap = wire_list_extension_property {
        ptr: support::new_leak_vec_ptr(
            <wire_ExtensionProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_kind_0(len: i32) -> *mut wire_list_kind {
    let wrap = wire_list_kind {
        ptr: support::new_leak_vec_ptr(Default::default(), len),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_language_property_0(
    len: i32,
) -> *mut wire_list_language_property {
    let wrap = wire_list_language_property {
        ptr: support::new_leak_vec_ptr(
            <wire_LanguageProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_pid_0(len: i32) -> *mut wire_list_pid {
    let wrap = wire_list_pid {
        ptr: support::new_leak_vec_ptr(<wire_Pid>::new_with_null_ptr(), len),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_secret_row_0(
    len: i32,
) -> *mut wire_list_secret_row {
    let wrap = wire_list_secret_row {
        ptr: support::new_leak_vec_ptr(
            <wire_SecretRow>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_secret_type_0(
    len: i32,
) -> *mut wire_list_secret_type {
    let wrap = wire_list_secret_type {
        ptr: support::new_leak_vec_ptr(Default::default(), len),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_summary_0(len: i32) -> *mut wire_list_summary {
    let wrap = wire_list_summary {
        ptr: support::new_leak_vec_ptr(
            <wire_Summary>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_text_list_property_0(
    len: i32,
) -> *mut wire_list_text_list_property {
    let wrap = wire_list_text_list_property {
        ptr: support::new_leak_vec_ptr(
            <wire_TextListProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_text_or_uri_property_0(
    len: i32,
) -> *mut wire_list_text_or_uri_property {
    let wrap = wire_list_text_or_uri_property {
        ptr: support::new_leak_vec_ptr(
            <wire_TextOrUriProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_text_property_0(
    len: i32,
) -> *mut wire_list_text_property {
    let wrap = wire_list_text_property {
        ptr: support::new_leak_vec_ptr(
            <wire_TextProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_time_offset_0(
    len: i32,
) -> *mut wire_list_time_offset {
    let wrap = wire_list_time_offset {
        ptr: support::new_leak_vec_ptr(
            <wire_TimeOffset>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_time_zone_property_0(
    len: i32,
) -> *mut wire_list_time_zone_property {
    let wrap = wire_list_time_zone_property {
        ptr: support::new_leak_vec_ptr(
            <wire_TimeZoneProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_type_parameter_0(
    len: i32,
) -> *mut wire_list_type_parameter {
    let wrap = wire_list_type_parameter {
        ptr: support::new_leak_vec_ptr(
            <wire_TypeParameter>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_list_uri_property_0(
    len: i32,
) -> *mut wire_list_uri_property {
    let wrap = wire_list_uri_property {
        ptr: support::new_leak_vec_ptr(
            <wire_UriProperty>::new_with_null_ptr(),
            len,
        ),
        len,
    };
    support::new_leak_box_ptr(wrap)
}

#[no_mangle]
pub extern "C" fn new_uint_8_list_0(len: i32) -> *mut wire_uint_8_list {
    let ans = wire_uint_8_list {
        ptr: support::new_leak_vec_ptr(Default::default(), len),
        len,
    };
    support::new_leak_box_ptr(ans)
}

// Section: related functions

// Section: impl Wire2Api

impl Wire2Api<String> for *mut wire_uint_8_list {
    fn wire2api(self) -> String {
        let vec: Vec<u8> = self.wire2api();
        String::from_utf8_lossy(&vec).into_owned()
    }
}
impl Wire2Api<Vec<String>> for *mut wire_StringList {
    fn wire2api(self) -> Vec<String> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<AddressProperty> for wire_AddressProperty {
    fn wire2api(self) -> AddressProperty {
        AddressProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<AnyProperty> for wire_AnyProperty {
    fn wire2api(self) -> AnyProperty {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Text);
                AnyProperty::Text(ans.field0.wire2api())
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Integer);
                AnyProperty::Integer(ans.field0.wire2api())
            },
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Float);
                AnyProperty::Float(ans.field0.wire2api())
            },
            3 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Boolean);
                AnyProperty::Boolean(ans.field0.wire2api())
            },
            4 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Date);
                AnyProperty::Date(ans.field0.wire2api())
            },
            5 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.DateTime);
                AnyProperty::DateTime(ans.field0.wire2api())
            },
            6 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Time);
                AnyProperty::Time(ans.field0.wire2api())
            },
            7 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.DateAndOrTime);
                AnyProperty::DateAndOrTime(ans.field0.wire2api())
            },
            8 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Timestamp);
                AnyProperty::Timestamp(ans.field0.wire2api())
            },
            9 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Uri);
                AnyProperty::Uri(ans.field0.wire2api())
            },
            10 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.UtcOffset);
                AnyProperty::UtcOffset(ans.field0.wire2api())
            },
            11 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Language);
                AnyProperty::Language(ans.field0.wire2api())
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<ArchiveFilter> for wire_ArchiveFilter {
    fn wire2api(self) -> ArchiveFilter {
        ArchiveFilter {
            id: self.id.wire2api(),
            include_documents: self.include_documents.wire2api(),
        }
    }
}

impl Wire2Api<AnyProperty> for *mut wire_AnyProperty {
    fn wire2api(self) -> AnyProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<AnyProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<ArchiveFilter> for *mut wire_ArchiveFilter {
    fn wire2api(self) -> ArchiveFilter {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<ArchiveFilter>::wire2api(*wrap).into()
    }
}
impl Wire2Api<CalendarDate> for *mut wire_CalendarDate {
    fn wire2api(self) -> CalendarDate {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<CalendarDate>::wire2api(*wrap).into()
    }
}
impl Wire2Api<DateAndOrTimeProperty> for *mut wire_DateAndOrTimeProperty {
    fn wire2api(self) -> DateAndOrTimeProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<DateAndOrTimeProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<DateTimeOrTextProperty> for *mut wire_DateTimeOrTextProperty {
    fn wire2api(self) -> DateTimeOrTextProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<DateTimeOrTextProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<DateTimeProperty> for *mut wire_DateTimeProperty {
    fn wire2api(self) -> DateTimeProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<DateTimeProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<GenderProperty> for *mut wire_GenderProperty {
    fn wire2api(self) -> GenderProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<GenderProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<ImportTarget> for *mut wire_ImportTarget {
    fn wire2api(self) -> ImportTarget {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<ImportTarget>::wire2api(*wrap).into()
    }
}
impl Wire2Api<KindProperty> for *mut wire_KindProperty {
    fn wire2api(self) -> KindProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<KindProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<Parameters> for *mut wire_Parameters {
    fn wire2api(self) -> Parameters {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<Parameters>::wire2api(*wrap).into()
    }
}
impl Wire2Api<PasswordGenerator> for *mut wire_PasswordGenerator {
    fn wire2api(self) -> PasswordGenerator {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<PasswordGenerator>::wire2api(*wrap).into()
    }
}
impl Wire2Api<QueryFilter> for *mut wire_QueryFilter {
    fn wire2api(self) -> QueryFilter {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<QueryFilter>::wire2api(*wrap).into()
    }
}
impl Wire2Api<RestoreOptions> for *mut wire_RestoreOptions {
    fn wire2api(self) -> RestoreOptions {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<RestoreOptions>::wire2api(*wrap).into()
    }
}
impl Wire2Api<Secret> for *mut wire_Secret {
    fn wire2api(self) -> Secret {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<Secret>::wire2api(*wrap).into()
    }
}
impl Wire2Api<SecretMeta> for *mut wire_SecretMeta {
    fn wire2api(self) -> SecretMeta {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<SecretMeta>::wire2api(*wrap).into()
    }
}
impl Wire2Api<Summary> for *mut wire_Summary {
    fn wire2api(self) -> Summary {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<Summary>::wire2api(*wrap).into()
    }
}
impl Wire2Api<TextListProperty> for *mut wire_TextListProperty {
    fn wire2api(self) -> TextListProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<TextListProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<TextOrUriProperty> for *mut wire_TextOrUriProperty {
    fn wire2api(self) -> TextOrUriProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<TextOrUriProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<TextProperty> for *mut wire_TextProperty {
    fn wire2api(self) -> TextProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<TextProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<TimeOffset> for *mut wire_TimeOffset {
    fn wire2api(self) -> TimeOffset {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<TimeOffset>::wire2api(*wrap).into()
    }
}
impl Wire2Api<TimeZoneParameter> for *mut wire_TimeZoneParameter {
    fn wire2api(self) -> TimeZoneParameter {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<TimeZoneParameter>::wire2api(*wrap).into()
    }
}
impl Wire2Api<TrustedDevice> for *mut wire_TrustedDevice {
    fn wire2api(self) -> TrustedDevice {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<TrustedDevice>::wire2api(*wrap).into()
    }
}
impl Wire2Api<u64> for *mut u64 {
    fn wire2api(self) -> u64 {
        unsafe { *support::box_from_leak_ptr(self) }
    }
}
impl Wire2Api<u8> for *mut u8 {
    fn wire2api(self) -> u8 {
        unsafe { *support::box_from_leak_ptr(self) }
    }
}
impl Wire2Api<UriProperty> for *mut wire_UriProperty {
    fn wire2api(self) -> UriProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<UriProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<UserData> for *mut wire_UserData {
    fn wire2api(self) -> UserData {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<UserData>::wire2api(*wrap).into()
    }
}
impl Wire2Api<UtcOffsetHms> for *mut wire_UtcOffsetHms {
    fn wire2api(self) -> UtcOffsetHms {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<UtcOffsetHms>::wire2api(*wrap).into()
    }
}
impl Wire2Api<UtcOffsetProperty> for *mut wire_UtcOffsetProperty {
    fn wire2api(self) -> UtcOffsetProperty {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<UtcOffsetProperty>::wire2api(*wrap).into()
    }
}
impl Wire2Api<ValueType> for *mut i32 {
    fn wire2api(self) -> ValueType {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<ValueType>::wire2api(*wrap).into()
    }
}
impl Wire2Api<Vcard> for *mut wire_Vcard {
    fn wire2api(self) -> Vcard {
        let wrap = unsafe { support::box_from_leak_ptr(self) };
        Wire2Api::<Vcard>::wire2api(*wrap).into()
    }
}
impl Wire2Api<CalendarDate> for wire_CalendarDate {
    fn wire2api(self) -> CalendarDate {
        CalendarDate {
            year: self.year.wire2api(),
            month: self.month.wire2api(),
            day: self.day.wire2api(),
        }
    }
}
impl Wire2Api<ClientPidMap> for wire_ClientPidMap {
    fn wire2api(self) -> ClientPidMap {
        ClientPidMap {
            source: self.source.wire2api(),
            uri: self.uri.wire2api(),
        }
    }
}
impl Wire2Api<ClientPidMapProperty> for wire_ClientPidMapProperty {
    fn wire2api(self) -> ClientPidMapProperty {
        ClientPidMapProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<Credential> for wire_Credential {
    fn wire2api(self) -> Credential {
        Credential {
            name: self.name.wire2api(),
            passphrase: self.passphrase.wire2api(),
        }
    }
}
impl Wire2Api<DateAndOrTime> for wire_DateAndOrTime {
    fn wire2api(self) -> DateAndOrTime {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Date);
                DateAndOrTime::Date(ans.field0.wire2api())
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.DateTime);
                DateAndOrTime::DateTime(ans.field0.wire2api())
            },
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Time);
                DateAndOrTime::Time(ans.field0.wire2api())
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<DateAndOrTimeProperty> for wire_DateAndOrTimeProperty {
    fn wire2api(self) -> DateAndOrTimeProperty {
        DateAndOrTimeProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<DateTimeOrTextProperty> for wire_DateTimeOrTextProperty {
    fn wire2api(self) -> DateTimeOrTextProperty {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.DateTime);
                DateTimeOrTextProperty::DateTime(ans.field0.wire2api())
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Text);
                DateTimeOrTextProperty::Text(ans.field0.wire2api())
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<DateTimeProperty> for wire_DateTimeProperty {
    fn wire2api(self) -> DateTimeProperty {
        DateTimeProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<DeliveryAddress> for wire_DeliveryAddress {
    fn wire2api(self) -> DeliveryAddress {
        DeliveryAddress {
            po_box: self.po_box.wire2api(),
            extended_address: self.extended_address.wire2api(),
            street_address: self.street_address.wire2api(),
            locality: self.locality.wire2api(),
            region: self.region.wire2api(),
            postal_code: self.postal_code.wire2api(),
            country_name: self.country_name.wire2api(),
        }
    }
}
impl Wire2Api<DocumentView> for wire_DocumentView {
    fn wire2api(self) -> DocumentView {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.All);
                DocumentView::All {
                    ignored_types: ans.ignored_types.wire2api(),
                }
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Vault);
                DocumentView::Vault(ans.field0.wire2api())
            },
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.TypeId);
                DocumentView::TypeId(ans.field0.wire2api())
            },
            3 => DocumentView::Favorites,
            4 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Tags);
                DocumentView::Tags(ans.field0.wire2api())
            },
            5 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Contact);
                DocumentView::Contact {
                    include_types: ans.include_types.wire2api(),
                }
            },
            6 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Documents);
                DocumentView::Documents {
                    vault_id: ans.vault_id.wire2api(),
                    identifiers: ans.identifiers.wire2api(),
                }
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<Extension> for wire_Extension {
    fn wire2api(self) -> Extension {
        Extension {
            name: self.name.wire2api(),
            value: self.value.wire2api(),
        }
    }
}
impl Wire2Api<ExtensionProperty> for wire_ExtensionProperty {
    fn wire2api(self) -> ExtensionProperty {
        ExtensionProperty {
            name: self.name.wire2api(),
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}

impl Wire2Api<Vec<f64>> for *mut wire_float_64_list {
    fn wire2api(self) -> Vec<f64> {
        unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        }
    }
}
impl Wire2Api<Gender> for wire_Gender {
    fn wire2api(self) -> Gender {
        Gender {
            sex: self.sex.wire2api(),
            identity: self.identity.wire2api(),
        }
    }
}
impl Wire2Api<GenderProperty> for wire_GenderProperty {
    fn wire2api(self) -> GenderProperty {
        GenderProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}

impl Wire2Api<ImportTarget> for wire_ImportTarget {
    fn wire2api(self) -> ImportTarget {
        ImportTarget {
            format: self.format.wire2api(),
            path: self.path.wire2api(),
            folder_name: self.folder_name.wire2api(),
        }
    }
}
impl Wire2Api<Vec<i64>> for *mut wire_int_64_list {
    fn wire2api(self) -> Vec<i64> {
        unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        }
    }
}

impl Wire2Api<KindProperty> for wire_KindProperty {
    fn wire2api(self) -> KindProperty {
        KindProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<LanguageProperty> for wire_LanguageProperty {
    fn wire2api(self) -> LanguageProperty {
        LanguageProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<Vec<AddressProperty>> for *mut wire_list_address_property {
    fn wire2api(self) -> Vec<AddressProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<CalendarDate>> for *mut wire_list_calendar_date {
    fn wire2api(self) -> Vec<CalendarDate> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<ClientPidMapProperty>>
    for *mut wire_list_client_pid_map_property
{
    fn wire2api(self) -> Vec<ClientPidMapProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<Credential>> for *mut wire_list_credential {
    fn wire2api(self) -> Vec<Credential> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<DateAndOrTime>> for *mut wire_list_date_and_or_time {
    fn wire2api(self) -> Vec<DateAndOrTime> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<DocumentView>> for *mut wire_list_document_view {
    fn wire2api(self) -> Vec<DocumentView> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<Extension>> for *mut wire_list_extension {
    fn wire2api(self) -> Vec<Extension> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<ExtensionProperty>> for *mut wire_list_extension_property {
    fn wire2api(self) -> Vec<ExtensionProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<Kind>> for *mut wire_list_kind {
    fn wire2api(self) -> Vec<Kind> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<LanguageProperty>> for *mut wire_list_language_property {
    fn wire2api(self) -> Vec<LanguageProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<Pid>> for *mut wire_list_pid {
    fn wire2api(self) -> Vec<Pid> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<SecretRow>> for *mut wire_list_secret_row {
    fn wire2api(self) -> Vec<SecretRow> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<SecretType>> for *mut wire_list_secret_type {
    fn wire2api(self) -> Vec<SecretType> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<Summary>> for *mut wire_list_summary {
    fn wire2api(self) -> Vec<Summary> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<TextListProperty>> for *mut wire_list_text_list_property {
    fn wire2api(self) -> Vec<TextListProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<TextOrUriProperty>>
    for *mut wire_list_text_or_uri_property
{
    fn wire2api(self) -> Vec<TextOrUriProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<TextProperty>> for *mut wire_list_text_property {
    fn wire2api(self) -> Vec<TextProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<TimeOffset>> for *mut wire_list_time_offset {
    fn wire2api(self) -> Vec<TimeOffset> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<TimeZoneProperty>> for *mut wire_list_time_zone_property {
    fn wire2api(self) -> Vec<TimeZoneProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<TypeParameter>> for *mut wire_list_type_parameter {
    fn wire2api(self) -> Vec<TypeParameter> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}
impl Wire2Api<Vec<UriProperty>> for *mut wire_list_uri_property {
    fn wire2api(self) -> Vec<UriProperty> {
        let vec = unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        };
        vec.into_iter().map(Wire2Api::wire2api).collect()
    }
}

impl Wire2Api<Parameters> for wire_Parameters {
    fn wire2api(self) -> Parameters {
        Parameters {
            language: self.language.wire2api(),
            value: self.value.wire2api(),
            pref: self.pref.wire2api(),
            alt_id: self.alt_id.wire2api(),
            pid: self.pid.wire2api(),
            types: self.types.wire2api(),
            media_type: self.media_type.wire2api(),
            calscale: self.calscale.wire2api(),
            sort_as: self.sort_as.wire2api(),
            geo: self.geo.wire2api(),
            timezone: self.timezone.wire2api(),
            label: self.label.wire2api(),
            extensions: self.extensions.wire2api(),
        }
    }
}
impl Wire2Api<PasswordGenerator> for wire_PasswordGenerator {
    fn wire2api(self) -> PasswordGenerator {
        PasswordGenerator {
            count: self.count.wire2api(),
            length: self.length.wire2api(),
            generator: self.generator.wire2api(),
        }
    }
}
impl Wire2Api<Pid> for wire_Pid {
    fn wire2api(self) -> Pid {
        Pid {
            local: self.local.wire2api(),
            source: self.source.wire2api(),
        }
    }
}
impl Wire2Api<QueryFilter> for wire_QueryFilter {
    fn wire2api(self) -> QueryFilter {
        QueryFilter {
            tags: self.tags.wire2api(),
            folders: self.folders.wire2api(),
            types: self.types.wire2api(),
        }
    }
}

impl Wire2Api<RestoreOptions> for wire_RestoreOptions {
    fn wire2api(self) -> RestoreOptions {
        RestoreOptions {
            selected: self.selected.wire2api(),
            passphrase: self.passphrase.wire2api(),
        }
    }
}
impl Wire2Api<Secret> for wire_Secret {
    fn wire2api(self) -> Secret {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Account);
                Secret::Account {
                    account: ans.account.wire2api(),
                    password: ans.password.wire2api(),
                    url: ans.url.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Note);
                Secret::Note {
                    text: ans.text.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Contact);
                Secret::Contact {
                    vcard: ans.vcard.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            3 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Identity);
                Secret::Identity {
                    id_kind: ans.id_kind.wire2api(),
                    number: ans.number.wire2api(),
                    issue_place: ans.issue_place.wire2api(),
                    issue_date: ans.issue_date.wire2api(),
                    expiry_date: ans.expiry_date.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            4 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.File);
                Secret::File {
                    name: ans.name.wire2api(),
                    mime: ans.mime.wire2api(),
                    buffer: ans.buffer.wire2api(),
                    checksum: ans.checksum.wire2api(),
                    external_storage: ans.external_storage.wire2api(),
                    size: ans.size.wire2api(),
                    user_data: ans.user_data.wire2api(),
                    path: ans.path.wire2api(),
                }
            },
            5 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Pem);
                Secret::Pem {
                    certificate: ans.certificate.wire2api(),
                    entries: ans.entries.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            6 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.List);
                Secret::List {
                    items: ans.items.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            7 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Totp);
                Secret::Totp {
                    digits: ans.digits.wire2api(),
                    step: ans.step.wire2api(),
                    issuer: ans.issuer.wire2api(),
                    account_name: ans.account_name.wire2api(),
                    url: ans.url.wire2api(),
                    secret_base32: ans.secret_base32.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            8 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Card);
                Secret::Card {
                    number: ans.number.wire2api(),
                    expiry: ans.expiry.wire2api(),
                    cvv: ans.cvv.wire2api(),
                    name: ans.name.wire2api(),
                    atm_pin: ans.atm_pin.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            9 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Bank);
                Secret::Bank {
                    number: ans.number.wire2api(),
                    routing: ans.routing.wire2api(),
                    iban: ans.iban.wire2api(),
                    swift: ans.swift.wire2api(),
                    bic: ans.bic.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            10 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Link);
                Secret::Link {
                    url: ans.url.wire2api(),
                    label: ans.label.wire2api(),
                    title: ans.title.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            11 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Password);
                Secret::Password {
                    password: ans.password.wire2api(),
                    name: ans.name.wire2api(),
                    user_data: ans.user_data.wire2api(),
                }
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<SecretMeta> for wire_SecretMeta {
    fn wire2api(self) -> SecretMeta {
        SecretMeta {
            kind: self.kind.wire2api(),
            flags: self.flags.wire2api(),
            label: self.label.wire2api(),
            last_updated: self.last_updated.wire2api(),
            tags: self.tags.wire2api(),
            favorite: self.favorite.wire2api(),
        }
    }
}
impl Wire2Api<SecretRow> for wire_SecretRow {
    fn wire2api(self) -> SecretRow {
        SecretRow {
            id: self.id.wire2api(),
            meta: self.meta.wire2api(),
            secret: self.secret.wire2api(),
        }
    }
}

impl Wire2Api<Summary> for wire_Summary {
    fn wire2api(self) -> Summary {
        Summary {
            version: self.version.wire2api(),
            id: self.id.wire2api(),
            name: self.name.wire2api(),
            algorithm: self.algorithm.wire2api(),
            flags: self.flags.wire2api(),
        }
    }
}

impl Wire2Api<TextListProperty> for wire_TextListProperty {
    fn wire2api(self) -> TextListProperty {
        TextListProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
            delimiter: self.delimiter.wire2api(),
        }
    }
}
impl Wire2Api<TextOrUriProperty> for wire_TextOrUriProperty {
    fn wire2api(self) -> TextOrUriProperty {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Text);
                TextOrUriProperty::Text(ans.field0.wire2api())
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Uri);
                TextOrUriProperty::Uri(ans.field0.wire2api())
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<TextProperty> for wire_TextProperty {
    fn wire2api(self) -> TextProperty {
        TextProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<TimeHms> for wire_TimeHms {
    fn wire2api(self) -> TimeHms {
        TimeHms {
            hours: self.hours.wire2api(),
            minutes: self.minutes.wire2api(),
            seconds: self.seconds.wire2api(),
            nano: self.nano.wire2api(),
        }
    }
}
impl Wire2Api<TimeOffset> for wire_TimeOffset {
    fn wire2api(self) -> TimeOffset {
        TimeOffset {
            time: self.time.wire2api(),
            offset: self.offset.wire2api(),
        }
    }
}
impl Wire2Api<TimeZoneParameter> for wire_TimeZoneParameter {
    fn wire2api(self) -> TimeZoneParameter {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Text);
                TimeZoneParameter::Text(ans.field0.wire2api())
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Uri);
                TimeZoneParameter::Uri(ans.field0.wire2api())
            },
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.UtcOffset);
                TimeZoneParameter::UtcOffset {
                    hours: ans.hours.wire2api(),
                    minutes: ans.minutes.wire2api(),
                    seconds: ans.seconds.wire2api(),
                }
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<TimeZoneProperty> for wire_TimeZoneProperty {
    fn wire2api(self) -> TimeZoneProperty {
        match self.tag {
            0 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Text);
                TimeZoneProperty::Text(ans.field0.wire2api())
            },
            1 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Uri);
                TimeZoneProperty::Uri(ans.field0.wire2api())
            },
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.UtcOffset);
                TimeZoneProperty::UtcOffset(ans.field0.wire2api())
            },
            _ => unreachable!(),
        }
    }
}
impl Wire2Api<TrustedDevice> for wire_TrustedDevice {
    fn wire2api(self) -> TrustedDevice {
        TrustedDevice {
            public_key: self.public_key.wire2api(),
            extra_info: self.extra_info.wire2api(),
            created_date: self.created_date.wire2api(),
            address: self.address.wire2api(),
            peer_id: self.peer_id.wire2api(),
        }
    }
}
impl Wire2Api<TypeParameter> for wire_TypeParameter {
    fn wire2api(self) -> TypeParameter {
        match self.tag {
            0 => TypeParameter::Home,
            1 => TypeParameter::Work,
            2 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Telephone);
                TypeParameter::Telephone(ans.field0.wire2api())
            },
            3 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Related);
                TypeParameter::Related(ans.field0.wire2api())
            },
            4 => unsafe {
                let ans = support::box_from_leak_ptr(self.kind);
                let ans = support::box_from_leak_ptr(ans.Extension);
                TypeParameter::Extension(ans.field0.wire2api())
            },
            _ => unreachable!(),
        }
    }
}

impl Wire2Api<Vec<u8>> for *mut wire_uint_8_list {
    fn wire2api(self) -> Vec<u8> {
        unsafe {
            let wrap = support::box_from_leak_ptr(self);
            support::vec_from_leak_ptr(wrap.ptr, wrap.len)
        }
    }
}
impl Wire2Api<UriProperty> for wire_UriProperty {
    fn wire2api(self) -> UriProperty {
        UriProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}
impl Wire2Api<UserData> for wire_UserData {
    fn wire2api(self) -> UserData {
        UserData {
            fields: self.fields.wire2api(),
            comment: self.comment.wire2api(),
            recovery_note: self.recovery_note.wire2api(),
        }
    }
}

impl Wire2Api<UtcOffsetHms> for wire_UtcOffsetHms {
    fn wire2api(self) -> UtcOffsetHms {
        UtcOffsetHms {
            hours: self.hours.wire2api(),
            minutes: self.minutes.wire2api(),
            seconds: self.seconds.wire2api(),
        }
    }
}
impl Wire2Api<UtcOffsetProperty> for wire_UtcOffsetProperty {
    fn wire2api(self) -> UtcOffsetProperty {
        UtcOffsetProperty {
            group: self.group.wire2api(),
            value: self.value.wire2api(),
            parameters: self.parameters.wire2api(),
        }
    }
}

impl Wire2Api<Vcard> for wire_Vcard {
    fn wire2api(self) -> Vcard {
        Vcard {
            source: self.source.wire2api(),
            kind: self.kind.wire2api(),
            xml: self.xml.wire2api(),
            formatted_name: self.formatted_name.wire2api(),
            name: self.name.wire2api(),
            nickname: self.nickname.wire2api(),
            photo: self.photo.wire2api(),
            bday: self.bday.wire2api(),
            anniversary: self.anniversary.wire2api(),
            gender: self.gender.wire2api(),
            url: self.url.wire2api(),
            address: self.address.wire2api(),
            tel: self.tel.wire2api(),
            email: self.email.wire2api(),
            impp: self.impp.wire2api(),
            lang: self.lang.wire2api(),
            title: self.title.wire2api(),
            role: self.role.wire2api(),
            logo: self.logo.wire2api(),
            org: self.org.wire2api(),
            member: self.member.wire2api(),
            related: self.related.wire2api(),
            timezone: self.timezone.wire2api(),
            geo: self.geo.wire2api(),
            categories: self.categories.wire2api(),
            note: self.note.wire2api(),
            prod_id: self.prod_id.wire2api(),
            rev: self.rev.wire2api(),
            sound: self.sound.wire2api(),
            uid: self.uid.wire2api(),
            client_pid_map: self.client_pid_map.wire2api(),
            key: self.key.wire2api(),
            fburl: self.fburl.wire2api(),
            cal_adr_uri: self.cal_adr_uri.wire2api(),
            cal_uri: self.cal_uri.wire2api(),
            extensions: self.extensions.wire2api(),
        }
    }
}
// Section: wire structs

#[repr(C)]
#[derive(Clone)]
pub struct wire_StringList {
    ptr: *mut *mut wire_uint_8_list,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AddressProperty {
    group: *mut wire_uint_8_list,
    value: wire_DeliveryAddress,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_ArchiveFilter {
    id: *mut wire_uint_8_list,
    include_documents: bool,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_CalendarDate {
    year: i32,
    month: *mut wire_uint_8_list,
    day: u8,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_ClientPidMap {
    source: u64,
    uri: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_ClientPidMapProperty {
    group: *mut wire_uint_8_list,
    value: wire_ClientPidMap,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Credential {
    name: *mut wire_uint_8_list,
    passphrase: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateAndOrTimeProperty {
    group: *mut wire_uint_8_list,
    value: *mut wire_list_date_and_or_time,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateTimeProperty {
    group: *mut wire_uint_8_list,
    value: *mut wire_uint_8_list,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DeliveryAddress {
    po_box: *mut wire_uint_8_list,
    extended_address: *mut wire_uint_8_list,
    street_address: *mut wire_uint_8_list,
    locality: *mut wire_uint_8_list,
    region: *mut wire_uint_8_list,
    postal_code: *mut wire_uint_8_list,
    country_name: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Extension {
    name: *mut wire_uint_8_list,
    value: *mut wire_StringList,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_ExtensionProperty {
    name: *mut wire_uint_8_list,
    group: *mut wire_uint_8_list,
    value: *mut wire_AnyProperty,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_float_64_list {
    ptr: *mut f64,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Gender {
    sex: i32,
    identity: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_GenderProperty {
    group: *mut wire_uint_8_list,
    value: wire_Gender,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_ImportTarget {
    format: i32,
    path: *mut wire_uint_8_list,
    folder_name: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_int_64_list {
    ptr: *mut i64,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_KindProperty {
    group: *mut wire_uint_8_list,
    value: i32,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_LanguageProperty {
    group: *mut wire_uint_8_list,
    value: *mut wire_uint_8_list,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_address_property {
    ptr: *mut wire_AddressProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_calendar_date {
    ptr: *mut wire_CalendarDate,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_client_pid_map_property {
    ptr: *mut wire_ClientPidMapProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_credential {
    ptr: *mut wire_Credential,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_date_and_or_time {
    ptr: *mut wire_DateAndOrTime,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_document_view {
    ptr: *mut wire_DocumentView,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_extension {
    ptr: *mut wire_Extension,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_extension_property {
    ptr: *mut wire_ExtensionProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_kind {
    ptr: *mut i32,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_language_property {
    ptr: *mut wire_LanguageProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_pid {
    ptr: *mut wire_Pid,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_secret_row {
    ptr: *mut wire_SecretRow,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_secret_type {
    ptr: *mut i32,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_summary {
    ptr: *mut wire_Summary,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_text_list_property {
    ptr: *mut wire_TextListProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_text_or_uri_property {
    ptr: *mut wire_TextOrUriProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_text_property {
    ptr: *mut wire_TextProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_time_offset {
    ptr: *mut wire_TimeOffset,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_time_zone_property {
    ptr: *mut wire_TimeZoneProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_type_parameter {
    ptr: *mut wire_TypeParameter,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_list_uri_property {
    ptr: *mut wire_UriProperty,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Parameters {
    language: *mut wire_uint_8_list,
    value: *mut i32,
    pref: *mut u8,
    alt_id: *mut wire_uint_8_list,
    pid: *mut wire_list_pid,
    types: *mut wire_list_type_parameter,
    media_type: *mut wire_uint_8_list,
    calscale: *mut wire_uint_8_list,
    sort_as: *mut wire_StringList,
    geo: *mut wire_uint_8_list,
    timezone: *mut wire_TimeZoneParameter,
    label: *mut wire_uint_8_list,
    extensions: *mut wire_list_extension,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_PasswordGenerator {
    count: usize,
    length: usize,
    generator: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Pid {
    local: u64,
    source: *mut u64,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_QueryFilter {
    tags: *mut wire_StringList,
    folders: *mut wire_StringList,
    types: *mut wire_list_secret_type,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_RestoreOptions {
    selected: *mut wire_list_summary,
    passphrase: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_SecretMeta {
    kind: i32,
    flags: u32,
    label: *mut wire_uint_8_list,
    last_updated: *mut wire_uint_8_list,
    tags: *mut wire_StringList,
    favorite: bool,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_SecretRow {
    id: *mut wire_uint_8_list,
    meta: wire_SecretMeta,
    secret: wire_Secret,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Summary {
    version: u16,
    id: *mut wire_uint_8_list,
    name: *mut wire_uint_8_list,
    algorithm: u8,
    flags: u64,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TextListProperty {
    group: *mut wire_uint_8_list,
    value: *mut wire_StringList,
    parameters: *mut wire_Parameters,
    delimiter: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TextProperty {
    group: *mut wire_uint_8_list,
    value: *mut wire_uint_8_list,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeHms {
    hours: u8,
    minutes: u8,
    seconds: u8,
    nano: u32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeOffset {
    time: wire_TimeHms,
    offset: wire_UtcOffsetHms,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TrustedDevice {
    public_key: *mut wire_uint_8_list,
    extra_info: *mut wire_uint_8_list,
    created_date: *mut wire_uint_8_list,
    address: *mut wire_uint_8_list,
    peer_id: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_uint_8_list {
    ptr: *mut u8,
    len: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_UriProperty {
    group: *mut wire_uint_8_list,
    value: *mut wire_uint_8_list,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_UserData {
    fields: *mut wire_list_secret_row,
    comment: *mut wire_uint_8_list,
    recovery_note: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_UtcOffsetHms {
    hours: i8,
    minutes: i8,
    seconds: i8,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_UtcOffsetProperty {
    group: *mut wire_uint_8_list,
    value: wire_UtcOffsetHms,
    parameters: *mut wire_Parameters,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Vcard {
    source: *mut wire_list_uri_property,
    kind: *mut wire_KindProperty,
    xml: *mut wire_list_text_property,
    formatted_name: *mut wire_list_text_property,
    name: *mut wire_TextListProperty,
    nickname: *mut wire_list_text_property,
    photo: *mut wire_list_text_or_uri_property,
    bday: *mut wire_DateTimeOrTextProperty,
    anniversary: *mut wire_DateTimeOrTextProperty,
    gender: *mut wire_GenderProperty,
    url: *mut wire_list_uri_property,
    address: *mut wire_list_address_property,
    tel: *mut wire_list_text_or_uri_property,
    email: *mut wire_list_text_property,
    impp: *mut wire_list_uri_property,
    lang: *mut wire_list_language_property,
    title: *mut wire_list_text_property,
    role: *mut wire_list_text_property,
    logo: *mut wire_list_uri_property,
    org: *mut wire_list_text_list_property,
    member: *mut wire_list_uri_property,
    related: *mut wire_list_text_or_uri_property,
    timezone: *mut wire_list_time_zone_property,
    geo: *mut wire_list_uri_property,
    categories: *mut wire_list_text_list_property,
    note: *mut wire_list_text_property,
    prod_id: *mut wire_TextProperty,
    rev: *mut wire_DateTimeProperty,
    sound: *mut wire_list_uri_property,
    uid: *mut wire_TextOrUriProperty,
    client_pid_map: *mut wire_list_client_pid_map_property,
    key: *mut wire_list_text_or_uri_property,
    fburl: *mut wire_list_uri_property,
    cal_adr_uri: *mut wire_list_uri_property,
    cal_uri: *mut wire_list_uri_property,
    extensions: *mut wire_list_extension_property,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty {
    tag: i32,
    kind: *mut AnyPropertyKind,
}

#[repr(C)]
pub union AnyPropertyKind {
    Text: *mut wire_AnyProperty_Text,
    Integer: *mut wire_AnyProperty_Integer,
    Float: *mut wire_AnyProperty_Float,
    Boolean: *mut wire_AnyProperty_Boolean,
    Date: *mut wire_AnyProperty_Date,
    DateTime: *mut wire_AnyProperty_DateTime,
    Time: *mut wire_AnyProperty_Time,
    DateAndOrTime: *mut wire_AnyProperty_DateAndOrTime,
    Timestamp: *mut wire_AnyProperty_Timestamp,
    Uri: *mut wire_AnyProperty_Uri,
    UtcOffset: *mut wire_AnyProperty_UtcOffset,
    Language: *mut wire_AnyProperty_Language,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Text {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Integer {
    field0: *mut wire_int_64_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Float {
    field0: *mut wire_float_64_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Boolean {
    field0: bool,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Date {
    field0: *mut wire_list_calendar_date,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_DateTime {
    field0: *mut wire_StringList,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Time {
    field0: *mut wire_list_time_offset,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_DateAndOrTime {
    field0: *mut wire_list_date_and_or_time,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Timestamp {
    field0: *mut wire_StringList,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Uri {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_UtcOffset {
    field0: *mut wire_UtcOffsetHms,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_AnyProperty_Language {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateAndOrTime {
    tag: i32,
    kind: *mut DateAndOrTimeKind,
}

#[repr(C)]
pub union DateAndOrTimeKind {
    Date: *mut wire_DateAndOrTime_Date,
    DateTime: *mut wire_DateAndOrTime_DateTime,
    Time: *mut wire_DateAndOrTime_Time,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateAndOrTime_Date {
    field0: *mut wire_CalendarDate,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateAndOrTime_DateTime {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateAndOrTime_Time {
    field0: *mut wire_TimeOffset,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateTimeOrTextProperty {
    tag: i32,
    kind: *mut DateTimeOrTextPropertyKind,
}

#[repr(C)]
pub union DateTimeOrTextPropertyKind {
    DateTime: *mut wire_DateTimeOrTextProperty_DateTime,
    Text: *mut wire_DateTimeOrTextProperty_Text,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateTimeOrTextProperty_DateTime {
    field0: *mut wire_DateAndOrTimeProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DateTimeOrTextProperty_Text {
    field0: *mut wire_TextProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView {
    tag: i32,
    kind: *mut DocumentViewKind,
}

#[repr(C)]
pub union DocumentViewKind {
    All: *mut wire_DocumentView_All,
    Vault: *mut wire_DocumentView_Vault,
    TypeId: *mut wire_DocumentView_TypeId,
    Favorites: *mut wire_DocumentView_Favorites,
    Tags: *mut wire_DocumentView_Tags,
    Contact: *mut wire_DocumentView_Contact,
    Documents: *mut wire_DocumentView_Documents,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_All {
    ignored_types: *mut wire_list_secret_type,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_Vault {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_TypeId {
    field0: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_Favorites {}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_Tags {
    field0: *mut wire_StringList,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_Contact {
    include_types: *mut wire_list_kind,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_DocumentView_Documents {
    vault_id: *mut wire_uint_8_list,
    identifiers: *mut wire_StringList,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret {
    tag: i32,
    kind: *mut SecretKind,
}

#[repr(C)]
pub union SecretKind {
    Account: *mut wire_Secret_Account,
    Note: *mut wire_Secret_Note,
    Contact: *mut wire_Secret_Contact,
    Identity: *mut wire_Secret_Identity,
    File: *mut wire_Secret_File,
    Pem: *mut wire_Secret_Pem,
    List: *mut wire_Secret_List,
    Totp: *mut wire_Secret_Totp,
    Card: *mut wire_Secret_Card,
    Bank: *mut wire_Secret_Bank,
    Link: *mut wire_Secret_Link,
    Password: *mut wire_Secret_Password,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Account {
    account: *mut wire_uint_8_list,
    password: *mut wire_uint_8_list,
    url: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Note {
    text: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Contact {
    vcard: *mut wire_Vcard,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Identity {
    id_kind: i32,
    number: *mut wire_uint_8_list,
    issue_place: *mut wire_uint_8_list,
    issue_date: *mut wire_uint_8_list,
    expiry_date: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_File {
    name: *mut wire_uint_8_list,
    mime: *mut wire_uint_8_list,
    buffer: *mut wire_uint_8_list,
    checksum: *mut wire_uint_8_list,
    external_storage: bool,
    size: u64,
    user_data: *mut wire_UserData,
    path: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Pem {
    certificate: *mut wire_uint_8_list,
    entries: usize,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_List {
    items: *mut wire_list_credential,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Totp {
    digits: usize,
    step: u64,
    issuer: *mut wire_uint_8_list,
    account_name: *mut wire_uint_8_list,
    url: *mut wire_uint_8_list,
    secret_base32: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Card {
    number: *mut wire_uint_8_list,
    expiry: *mut wire_uint_8_list,
    cvv: *mut wire_uint_8_list,
    name: *mut wire_uint_8_list,
    atm_pin: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Bank {
    number: *mut wire_uint_8_list,
    routing: *mut wire_uint_8_list,
    iban: *mut wire_uint_8_list,
    swift: *mut wire_uint_8_list,
    bic: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Link {
    url: *mut wire_uint_8_list,
    label: *mut wire_uint_8_list,
    title: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_Secret_Password {
    password: *mut wire_uint_8_list,
    name: *mut wire_uint_8_list,
    user_data: *mut wire_UserData,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TextOrUriProperty {
    tag: i32,
    kind: *mut TextOrUriPropertyKind,
}

#[repr(C)]
pub union TextOrUriPropertyKind {
    Text: *mut wire_TextOrUriProperty_Text,
    Uri: *mut wire_TextOrUriProperty_Uri,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TextOrUriProperty_Text {
    field0: *mut wire_TextProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TextOrUriProperty_Uri {
    field0: *mut wire_UriProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneParameter {
    tag: i32,
    kind: *mut TimeZoneParameterKind,
}

#[repr(C)]
pub union TimeZoneParameterKind {
    Text: *mut wire_TimeZoneParameter_Text,
    Uri: *mut wire_TimeZoneParameter_Uri,
    UtcOffset: *mut wire_TimeZoneParameter_UtcOffset,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneParameter_Text {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneParameter_Uri {
    field0: *mut wire_uint_8_list,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneParameter_UtcOffset {
    hours: i8,
    minutes: i8,
    seconds: i8,
}
#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneProperty {
    tag: i32,
    kind: *mut TimeZonePropertyKind,
}

#[repr(C)]
pub union TimeZonePropertyKind {
    Text: *mut wire_TimeZoneProperty_Text,
    Uri: *mut wire_TimeZoneProperty_Uri,
    UtcOffset: *mut wire_TimeZoneProperty_UtcOffset,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneProperty_Text {
    field0: *mut wire_TextProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneProperty_Uri {
    field0: *mut wire_UriProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TimeZoneProperty_UtcOffset {
    field0: *mut wire_UtcOffsetProperty,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TypeParameter {
    tag: i32,
    kind: *mut TypeParameterKind,
}

#[repr(C)]
pub union TypeParameterKind {
    Home: *mut wire_TypeParameter_Home,
    Work: *mut wire_TypeParameter_Work,
    Telephone: *mut wire_TypeParameter_Telephone,
    Related: *mut wire_TypeParameter_Related,
    Extension: *mut wire_TypeParameter_Extension,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TypeParameter_Home {}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TypeParameter_Work {}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TypeParameter_Telephone {
    field0: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TypeParameter_Related {
    field0: i32,
}

#[repr(C)]
#[derive(Clone)]
pub struct wire_TypeParameter_Extension {
    field0: *mut wire_uint_8_list,
}

// Section: impl NewWithNullPtr

pub trait NewWithNullPtr {
    fn new_with_null_ptr() -> Self;
}

impl<T> NewWithNullPtr for *mut T {
    fn new_with_null_ptr() -> Self {
        std::ptr::null_mut()
    }
}

impl NewWithNullPtr for wire_AddressProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: Default::default(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_AddressProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_AnyProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_AnyProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Text() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Text: support::new_leak_box_ptr(wire_AnyProperty_Text {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Integer() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Integer: support::new_leak_box_ptr(wire_AnyProperty_Integer {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Float() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Float: support::new_leak_box_ptr(wire_AnyProperty_Float {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Boolean() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Boolean: support::new_leak_box_ptr(wire_AnyProperty_Boolean {
            field0: Default::default(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Date() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Date: support::new_leak_box_ptr(wire_AnyProperty_Date {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_DateTime() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        DateTime: support::new_leak_box_ptr(wire_AnyProperty_DateTime {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Time() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Time: support::new_leak_box_ptr(wire_AnyProperty_Time {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_DateAndOrTime() -> *mut AnyPropertyKind
{
    support::new_leak_box_ptr(AnyPropertyKind {
        DateAndOrTime: support::new_leak_box_ptr(
            wire_AnyProperty_DateAndOrTime {
                field0: core::ptr::null_mut(),
            },
        ),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Timestamp() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Timestamp: support::new_leak_box_ptr(wire_AnyProperty_Timestamp {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Uri() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Uri: support::new_leak_box_ptr(wire_AnyProperty_Uri {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_UtcOffset() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        UtcOffset: support::new_leak_box_ptr(wire_AnyProperty_UtcOffset {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_AnyProperty_Language() -> *mut AnyPropertyKind {
    support::new_leak_box_ptr(AnyPropertyKind {
        Language: support::new_leak_box_ptr(wire_AnyProperty_Language {
            field0: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_ArchiveFilter {
    fn new_with_null_ptr() -> Self {
        Self {
            id: core::ptr::null_mut(),
            include_documents: Default::default(),
        }
    }
}

impl Default for wire_ArchiveFilter {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_CalendarDate {
    fn new_with_null_ptr() -> Self {
        Self {
            year: Default::default(),
            month: core::ptr::null_mut(),
            day: Default::default(),
        }
    }
}

impl Default for wire_CalendarDate {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_ClientPidMap {
    fn new_with_null_ptr() -> Self {
        Self {
            source: Default::default(),
            uri: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_ClientPidMap {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_ClientPidMapProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: Default::default(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_ClientPidMapProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Credential {
    fn new_with_null_ptr() -> Self {
        Self {
            name: core::ptr::null_mut(),
            passphrase: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_Credential {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_DateAndOrTime {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_DateAndOrTime {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_DateAndOrTime_Date() -> *mut DateAndOrTimeKind {
    support::new_leak_box_ptr(DateAndOrTimeKind {
        Date: support::new_leak_box_ptr(wire_DateAndOrTime_Date {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DateAndOrTime_DateTime() -> *mut DateAndOrTimeKind {
    support::new_leak_box_ptr(DateAndOrTimeKind {
        DateTime: support::new_leak_box_ptr(wire_DateAndOrTime_DateTime {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DateAndOrTime_Time() -> *mut DateAndOrTimeKind {
    support::new_leak_box_ptr(DateAndOrTimeKind {
        Time: support::new_leak_box_ptr(wire_DateAndOrTime_Time {
            field0: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_DateAndOrTimeProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_DateAndOrTimeProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_DateTimeOrTextProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_DateTimeOrTextProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_DateTimeOrTextProperty_DateTime(
) -> *mut DateTimeOrTextPropertyKind {
    support::new_leak_box_ptr(DateTimeOrTextPropertyKind {
        DateTime: support::new_leak_box_ptr(
            wire_DateTimeOrTextProperty_DateTime {
                field0: core::ptr::null_mut(),
            },
        ),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DateTimeOrTextProperty_Text(
) -> *mut DateTimeOrTextPropertyKind {
    support::new_leak_box_ptr(DateTimeOrTextPropertyKind {
        Text: support::new_leak_box_ptr(wire_DateTimeOrTextProperty_Text {
            field0: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_DateTimeProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_DateTimeProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_DeliveryAddress {
    fn new_with_null_ptr() -> Self {
        Self {
            po_box: core::ptr::null_mut(),
            extended_address: core::ptr::null_mut(),
            street_address: core::ptr::null_mut(),
            locality: core::ptr::null_mut(),
            region: core::ptr::null_mut(),
            postal_code: core::ptr::null_mut(),
            country_name: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_DeliveryAddress {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_DocumentView {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_DocumentView {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_DocumentView_All() -> *mut DocumentViewKind {
    support::new_leak_box_ptr(DocumentViewKind {
        All: support::new_leak_box_ptr(wire_DocumentView_All {
            ignored_types: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DocumentView_Vault() -> *mut DocumentViewKind {
    support::new_leak_box_ptr(DocumentViewKind {
        Vault: support::new_leak_box_ptr(wire_DocumentView_Vault {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DocumentView_TypeId() -> *mut DocumentViewKind {
    support::new_leak_box_ptr(DocumentViewKind {
        TypeId: support::new_leak_box_ptr(wire_DocumentView_TypeId {
            field0: Default::default(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DocumentView_Tags() -> *mut DocumentViewKind {
    support::new_leak_box_ptr(DocumentViewKind {
        Tags: support::new_leak_box_ptr(wire_DocumentView_Tags {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DocumentView_Contact() -> *mut DocumentViewKind {
    support::new_leak_box_ptr(DocumentViewKind {
        Contact: support::new_leak_box_ptr(wire_DocumentView_Contact {
            include_types: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_DocumentView_Documents() -> *mut DocumentViewKind {
    support::new_leak_box_ptr(DocumentViewKind {
        Documents: support::new_leak_box_ptr(wire_DocumentView_Documents {
            vault_id: core::ptr::null_mut(),
            identifiers: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_Extension {
    fn new_with_null_ptr() -> Self {
        Self {
            name: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_Extension {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_ExtensionProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            name: core::ptr::null_mut(),
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_ExtensionProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Gender {
    fn new_with_null_ptr() -> Self {
        Self {
            sex: Default::default(),
            identity: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_Gender {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_GenderProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: Default::default(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_GenderProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_ImportTarget {
    fn new_with_null_ptr() -> Self {
        Self {
            format: Default::default(),
            path: core::ptr::null_mut(),
            folder_name: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_ImportTarget {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_KindProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: Default::default(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_KindProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_LanguageProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_LanguageProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Parameters {
    fn new_with_null_ptr() -> Self {
        Self {
            language: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            pref: core::ptr::null_mut(),
            alt_id: core::ptr::null_mut(),
            pid: core::ptr::null_mut(),
            types: core::ptr::null_mut(),
            media_type: core::ptr::null_mut(),
            calscale: core::ptr::null_mut(),
            sort_as: core::ptr::null_mut(),
            geo: core::ptr::null_mut(),
            timezone: core::ptr::null_mut(),
            label: core::ptr::null_mut(),
            extensions: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_Parameters {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_PasswordGenerator {
    fn new_with_null_ptr() -> Self {
        Self {
            count: Default::default(),
            length: Default::default(),
            generator: Default::default(),
        }
    }
}

impl Default for wire_PasswordGenerator {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Pid {
    fn new_with_null_ptr() -> Self {
        Self {
            local: Default::default(),
            source: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_Pid {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_QueryFilter {
    fn new_with_null_ptr() -> Self {
        Self {
            tags: core::ptr::null_mut(),
            folders: core::ptr::null_mut(),
            types: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_QueryFilter {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_RestoreOptions {
    fn new_with_null_ptr() -> Self {
        Self {
            selected: core::ptr::null_mut(),
            passphrase: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_RestoreOptions {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_Secret {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Secret {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Account() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Account: support::new_leak_box_ptr(wire_Secret_Account {
            account: core::ptr::null_mut(),
            password: core::ptr::null_mut(),
            url: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Note() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Note: support::new_leak_box_ptr(wire_Secret_Note {
            text: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Contact() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Contact: support::new_leak_box_ptr(wire_Secret_Contact {
            vcard: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Identity() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Identity: support::new_leak_box_ptr(wire_Secret_Identity {
            id_kind: Default::default(),
            number: core::ptr::null_mut(),
            issue_place: core::ptr::null_mut(),
            issue_date: core::ptr::null_mut(),
            expiry_date: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_File() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        File: support::new_leak_box_ptr(wire_Secret_File {
            name: core::ptr::null_mut(),
            mime: core::ptr::null_mut(),
            buffer: core::ptr::null_mut(),
            checksum: core::ptr::null_mut(),
            external_storage: Default::default(),
            size: Default::default(),
            user_data: core::ptr::null_mut(),
            path: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Pem() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Pem: support::new_leak_box_ptr(wire_Secret_Pem {
            certificate: core::ptr::null_mut(),
            entries: Default::default(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_List() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        List: support::new_leak_box_ptr(wire_Secret_List {
            items: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Totp() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Totp: support::new_leak_box_ptr(wire_Secret_Totp {
            digits: Default::default(),
            step: Default::default(),
            issuer: core::ptr::null_mut(),
            account_name: core::ptr::null_mut(),
            url: core::ptr::null_mut(),
            secret_base32: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Card() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Card: support::new_leak_box_ptr(wire_Secret_Card {
            number: core::ptr::null_mut(),
            expiry: core::ptr::null_mut(),
            cvv: core::ptr::null_mut(),
            name: core::ptr::null_mut(),
            atm_pin: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Bank() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Bank: support::new_leak_box_ptr(wire_Secret_Bank {
            number: core::ptr::null_mut(),
            routing: core::ptr::null_mut(),
            iban: core::ptr::null_mut(),
            swift: core::ptr::null_mut(),
            bic: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Link() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Link: support::new_leak_box_ptr(wire_Secret_Link {
            url: core::ptr::null_mut(),
            label: core::ptr::null_mut(),
            title: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_Secret_Password() -> *mut SecretKind {
    support::new_leak_box_ptr(SecretKind {
        Password: support::new_leak_box_ptr(wire_Secret_Password {
            password: core::ptr::null_mut(),
            name: core::ptr::null_mut(),
            user_data: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_SecretMeta {
    fn new_with_null_ptr() -> Self {
        Self {
            kind: Default::default(),
            flags: Default::default(),
            label: core::ptr::null_mut(),
            last_updated: core::ptr::null_mut(),
            tags: core::ptr::null_mut(),
            favorite: Default::default(),
        }
    }
}

impl Default for wire_SecretMeta {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_SecretRow {
    fn new_with_null_ptr() -> Self {
        Self {
            id: core::ptr::null_mut(),
            meta: Default::default(),
            secret: Default::default(),
        }
    }
}

impl Default for wire_SecretRow {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Summary {
    fn new_with_null_ptr() -> Self {
        Self {
            version: Default::default(),
            id: core::ptr::null_mut(),
            name: core::ptr::null_mut(),
            algorithm: Default::default(),
            flags: Default::default(),
        }
    }
}

impl Default for wire_Summary {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TextListProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
            delimiter: Default::default(),
        }
    }
}

impl Default for wire_TextListProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_TextOrUriProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TextOrUriProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_TextOrUriProperty_Text(
) -> *mut TextOrUriPropertyKind {
    support::new_leak_box_ptr(TextOrUriPropertyKind {
        Text: support::new_leak_box_ptr(wire_TextOrUriProperty_Text {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TextOrUriProperty_Uri() -> *mut TextOrUriPropertyKind
{
    support::new_leak_box_ptr(TextOrUriPropertyKind {
        Uri: support::new_leak_box_ptr(wire_TextOrUriProperty_Uri {
            field0: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_TextProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_TextProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TimeHms {
    fn new_with_null_ptr() -> Self {
        Self {
            hours: Default::default(),
            minutes: Default::default(),
            seconds: Default::default(),
            nano: Default::default(),
        }
    }
}

impl Default for wire_TimeHms {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TimeOffset {
    fn new_with_null_ptr() -> Self {
        Self {
            time: Default::default(),
            offset: Default::default(),
        }
    }
}

impl Default for wire_TimeOffset {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_TimeZoneParameter {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TimeZoneParameter {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_TimeZoneParameter_Text(
) -> *mut TimeZoneParameterKind {
    support::new_leak_box_ptr(TimeZoneParameterKind {
        Text: support::new_leak_box_ptr(wire_TimeZoneParameter_Text {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TimeZoneParameter_Uri() -> *mut TimeZoneParameterKind
{
    support::new_leak_box_ptr(TimeZoneParameterKind {
        Uri: support::new_leak_box_ptr(wire_TimeZoneParameter_Uri {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TimeZoneParameter_UtcOffset(
) -> *mut TimeZoneParameterKind {
    support::new_leak_box_ptr(TimeZoneParameterKind {
        UtcOffset: support::new_leak_box_ptr(
            wire_TimeZoneParameter_UtcOffset {
                hours: Default::default(),
                minutes: Default::default(),
                seconds: Default::default(),
            },
        ),
    })
}

impl Default for wire_TimeZoneProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TimeZoneProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_TimeZoneProperty_Text() -> *mut TimeZonePropertyKind
{
    support::new_leak_box_ptr(TimeZonePropertyKind {
        Text: support::new_leak_box_ptr(wire_TimeZoneProperty_Text {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TimeZoneProperty_Uri() -> *mut TimeZonePropertyKind
{
    support::new_leak_box_ptr(TimeZonePropertyKind {
        Uri: support::new_leak_box_ptr(wire_TimeZoneProperty_Uri {
            field0: core::ptr::null_mut(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TimeZoneProperty_UtcOffset(
) -> *mut TimeZonePropertyKind {
    support::new_leak_box_ptr(TimeZonePropertyKind {
        UtcOffset: support::new_leak_box_ptr(
            wire_TimeZoneProperty_UtcOffset {
                field0: core::ptr::null_mut(),
            },
        ),
    })
}

impl NewWithNullPtr for wire_TrustedDevice {
    fn new_with_null_ptr() -> Self {
        Self {
            public_key: core::ptr::null_mut(),
            extra_info: core::ptr::null_mut(),
            created_date: core::ptr::null_mut(),
            address: core::ptr::null_mut(),
            peer_id: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_TrustedDevice {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl Default for wire_TypeParameter {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_TypeParameter {
    fn new_with_null_ptr() -> Self {
        Self {
            tag: -1,
            kind: core::ptr::null_mut(),
        }
    }
}

#[no_mangle]
pub extern "C" fn inflate_TypeParameter_Telephone() -> *mut TypeParameterKind
{
    support::new_leak_box_ptr(TypeParameterKind {
        Telephone: support::new_leak_box_ptr(wire_TypeParameter_Telephone {
            field0: Default::default(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TypeParameter_Related() -> *mut TypeParameterKind {
    support::new_leak_box_ptr(TypeParameterKind {
        Related: support::new_leak_box_ptr(wire_TypeParameter_Related {
            field0: Default::default(),
        }),
    })
}

#[no_mangle]
pub extern "C" fn inflate_TypeParameter_Extension() -> *mut TypeParameterKind
{
    support::new_leak_box_ptr(TypeParameterKind {
        Extension: support::new_leak_box_ptr(wire_TypeParameter_Extension {
            field0: core::ptr::null_mut(),
        }),
    })
}

impl NewWithNullPtr for wire_UriProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: core::ptr::null_mut(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_UriProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_UserData {
    fn new_with_null_ptr() -> Self {
        Self {
            fields: core::ptr::null_mut(),
            comment: core::ptr::null_mut(),
            recovery_note: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_UserData {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_UtcOffsetHms {
    fn new_with_null_ptr() -> Self {
        Self {
            hours: Default::default(),
            minutes: Default::default(),
            seconds: Default::default(),
        }
    }
}

impl Default for wire_UtcOffsetHms {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_UtcOffsetProperty {
    fn new_with_null_ptr() -> Self {
        Self {
            group: core::ptr::null_mut(),
            value: Default::default(),
            parameters: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_UtcOffsetProperty {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

impl NewWithNullPtr for wire_Vcard {
    fn new_with_null_ptr() -> Self {
        Self {
            source: core::ptr::null_mut(),
            kind: core::ptr::null_mut(),
            xml: core::ptr::null_mut(),
            formatted_name: core::ptr::null_mut(),
            name: core::ptr::null_mut(),
            nickname: core::ptr::null_mut(),
            photo: core::ptr::null_mut(),
            bday: core::ptr::null_mut(),
            anniversary: core::ptr::null_mut(),
            gender: core::ptr::null_mut(),
            url: core::ptr::null_mut(),
            address: core::ptr::null_mut(),
            tel: core::ptr::null_mut(),
            email: core::ptr::null_mut(),
            impp: core::ptr::null_mut(),
            lang: core::ptr::null_mut(),
            title: core::ptr::null_mut(),
            role: core::ptr::null_mut(),
            logo: core::ptr::null_mut(),
            org: core::ptr::null_mut(),
            member: core::ptr::null_mut(),
            related: core::ptr::null_mut(),
            timezone: core::ptr::null_mut(),
            geo: core::ptr::null_mut(),
            categories: core::ptr::null_mut(),
            note: core::ptr::null_mut(),
            prod_id: core::ptr::null_mut(),
            rev: core::ptr::null_mut(),
            sound: core::ptr::null_mut(),
            uid: core::ptr::null_mut(),
            client_pid_map: core::ptr::null_mut(),
            key: core::ptr::null_mut(),
            fburl: core::ptr::null_mut(),
            cal_adr_uri: core::ptr::null_mut(),
            cal_uri: core::ptr::null_mut(),
            extensions: core::ptr::null_mut(),
        }
    }
}

impl Default for wire_Vcard {
    fn default() -> Self {
        Self::new_with_null_ptr()
    }
}

// Section: sync execution mode utility

#[no_mangle]
pub extern "C" fn free_WireSyncReturn(ptr: support::WireSyncReturn) {
    unsafe {
        let _ = support::box_from_leak_ptr(ptr);
    };
}
@tmpfs tmpfs changed the title Field has incomplete type for recursive types definitions (declaration order)) Field has incomplete type for recursive types definitions (declaration order) May 17, 2023
@emilio
Copy link
Collaborator

emilio commented May 29, 2023

So right now add_dependencies for a Ptr type just adds the dependencies of the associated type:

ty.add_dependencies_ignoring_generics(generic_params, library, out);

To support this properly we'd need to somehow store the information of the type needing only a forward declaration (rather than a full definition).

@emilio
Copy link
Collaborator

emilio commented May 29, 2023

Minimal example:

#[repr(C)]
struct A {
    buf: *mut B,
    len: usize,
}

#[repr(C)]
struct B {
    something: i32,
    nested: A,
}

#[no_mangle]
pub extern "C" fn root(foo: &B) {}

@emilio emilio added the bug label May 29, 2023
@emilio
Copy link
Collaborator

emilio commented May 29, 2023

Duplicate of #43. I think a patch for this would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants