2 // For each record declared in the UDL, we assume the caller has provided a corresponding
3 // rust `struct` with the declared fields. We provide the traits for sending it across the FFI.
4 // If the caller's struct does not match the shape and types declared in the UDL then the rust
5 // compiler will complain with a type error.
7 // We define a unit-struct to implement the trait to sidestep Rust's orphan rule (ADR-0006). It's
8 // public so other crates can refer to it via an `[External='crate'] typedef`
11 #[::uniffi::derive_record_for_udl]
12 struct r#{{ rec.name() }} {
13 {%- for field in rec.fields() %}
14 r#{{ field.name() }}: {{ field.as_type().borrow()|type_rs }},