// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!
{% import "macros.rs" as rs %}

::uniffi::setup_scaffolding!("{{ ci.namespace() }}");

{% include "UdlMetadata.rs" %}

{% for ty in ci.iter_types() %}
{%- match ty %}
{%- when Type::Map { key_type: k, value_type: v } -%}
{# Next comment MUST be after the line to be in the compiler output #}
uniffi::deps::static_assertions::assert_impl_all!({{ k|type_rs }}: ::std::cmp::Eq, ::std::hash::Hash); // record<{{ k|type_rs }}, {{ v|type_rs }}>
{%- else %}
{%- endmatch %}
{% endfor %}

{% for e in ci.enum_definitions() %}
{% if ci.is_name_used_as_error(e.name()) %}
// Error definitions, corresponding to `error` in the UDL.
{% include "ErrorTemplate.rs" %}
{% else %}
// Enum definitions, corresponding to `enum` in UDL.
{% include "EnumTemplate.rs" %}
{% endif %}
{% endfor %}

// Record definitions, implemented as method-less structs, corresponding to `dictionary` objects.
{% for rec in ci.record_definitions() %}
{% include "RecordTemplate.rs" %}
{% endfor %}

// Top level functions, corresponding to UDL `namespace` functions.
{%- for func in ci.function_definitions() %}
{% include "TopLevelFunctionTemplate.rs" %}
{% endfor -%}

// Object definitions, corresponding to UDL `interface` definitions.
{% for obj in ci.object_definitions() %}
{% include "ObjectTemplate.rs" %}
{% endfor %}

// Callback Interface definitions, corresponding to UDL `callback interface` definitions.
{% for cbi in ci.callback_interface_definitions() %}
{% include "CallbackInterfaceTemplate.rs" %}
{% endfor %}

// External and Wrapped types
{% include "ExternalTypesTemplate.rs" %}

// Export scaffolding checksums for UDL items
{% include "Checksums.rs" %}
