From 298223730b7b7d2cc678749d882a00f4cdc279b8 Mon Sep 17 00:00:00 2001 From: "uniffi-docs[bot]" Date: Fri, 20 Dec 2024 02:08:56 +0000 Subject: [PATCH] Deployed fbe146ff9 to next with MkDocs 1.6.0 and mike 2.1.1 --- next/404.html | 23 +- next/Getting_started.html | 23 +- next/Motivation.html | 23 +- next/Upgrading.html | 121 +- next/bindings.html | 23 +- next/describing.html | 23 +- next/foreign_traits.html | 23 +- next/futures.html | 23 +- next/index.html | 23 +- next/internals/async.html | 23 +- next/internals/crates.html | 23 +- next/internals/design_principles.html | 23 +- next/internals/lifting_and_lowering.html | 23 +- next/internals/object_references.html | 23 +- .../internals/rendering_foreign_bindings.html | 23 +- next/kotlin/configuration.html | 23 +- next/kotlin/gradle.html | 23 +- next/kotlin/lifetimes.html | 23 +- next/proc_macro/docstrings.html | 23 +- next/proc_macro/enumerations.html | 23 +- next/proc_macro/errors.html | 23 +- next/proc_macro/functions.html | 23 +- next/proc_macro/index.html | 23 +- next/proc_macro/interfaces.html | 23 +- next/proc_macro/records.html | 23 +- next/python/configuration.html | 23 +- next/swift/configuration.html | 23 +- next/swift/module.html | 23 +- next/swift/overview.html | 23 +- next/swift/uniffi-bindgen-swift.html | 23 +- next/swift/xcode.html | 23 +- next/tutorial/Prerequisites.html | 23 +- next/tutorial/Rust_scaffolding.html | 23 +- next/tutorial/foreign_language_bindings.html | 45 +- next/tutorial/udl_file.html | 23 +- next/types/builtin_types.html | 23 +- next/types/callback_interfaces.html | 23 +- next/types/custom_types.html | 23 +- next/types/enumerations.html | 23 +- next/types/errors.html | 23 +- next/types/functions.html | 23 +- next/types/interfaces.html | 23 +- next/types/namespace.html | 23 +- next/types/records.html | 23 +- next/types/remote_ext_types.html | 24 +- next/udl/docstrings.html | 25 +- next/udl/enumerations.html | 23 +- next/udl/errors.html | 23 +- next/udl/external_types.html | 1799 +++++++++++++++++ next/udl/functions.html | 23 +- next/udl/index.html | 23 +- next/udl/interfaces.html | 23 +- next/udl/records.html | 25 +- 53 files changed, 3052 insertions(+), 68 deletions(-) create mode 100644 next/udl/external_types.html diff --git a/next/404.html b/next/404.html index 4bfe6b4b9..7f30675e8 100644 --- a/next/404.html +++ b/next/404.html @@ -851,6 +851,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1629,7 +1650,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/Getting_started.html b/next/Getting_started.html index 51b48b38b..c3681c8da 100644 --- a/next/Getting_started.html +++ b/next/Getting_started.html @@ -872,6 +872,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/Motivation.html b/next/Motivation.html index 7313fe963..45d96201d 100644 --- a/next/Motivation.html +++ b/next/Motivation.html @@ -930,6 +930,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1708,7 +1729,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/Upgrading.html b/next/Upgrading.html index b058dba15..075648203 100644 --- a/next/Upgrading.html +++ b/next/Upgrading.html @@ -18,7 +18,7 @@ - v0.28.x -> v0.29.x - The UniFFI user guide + Upgrading v0.28.x -> v0.29.x - The UniFFI user guide @@ -60,7 +60,7 @@
    - + Skip to content @@ -100,7 +100,7 @@
    - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x
    @@ -858,6 +858,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1645,7 +1666,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x @@ -1656,7 +1677,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x @@ -1684,6 +1705,33 @@ +
  • + +
  • + + + External Types + + + +
  • + +
  • + + + Remote Types + + + +
  • + +
  • + + + Shared Rust/UDL types + + +
  • @@ -1727,6 +1775,33 @@ + + +
  • + + + External Types + + + +
  • + +
  • + + + Remote Types + + + +
  • + +
  • + + + Shared Rust/UDL types + + +
  • @@ -1747,7 +1822,13 @@ -

    v0.28.x -> v0.29.x

    +

    Upgrading v0.28.x -> v0.29.x

    +

    We've made a number of breaking changes in this release, particularly +to:

    +

    Custom types

    Custom types are now implemented using a macro rather than implementing the UniffiCustomTypeConverter trait, addressing some edge-cases with custom types wrapping types from other crates (eg, Url).

    @@ -1772,6 +1853,34 @@

    Custom types

    The custom_type! macro is more flexible than the old system - eg, the closures can be omitted in many cases where From and Into exist. See the Custom Types for details.

    +

    External Types

    +

    External types can no longer be described in UDL via extern - instead, you must specify the type.

    +

    For example: +

    [External="crate_name"]
    +typedef extern MyEnum
    +
    +is no longer accepted - you must use, eg: +
    [External="crate_name"]
    +typedef enum MyEnum
    +

    +

    Edge-cases broken include:

    + +

    See Remote and External Types for more detail.

    +

    Remote Types

    +

    The macros ffi_converter_forward and all use_* macros (eg, use_udl_record!, use_udl_object!, use_udl_enum! etc) +are now unnecessary so have been removed.

    +

    See Remote and External Types for more detail.

    +

    Shared Rust/UDL types

    +

    The Rust attribute has been removed - use the same typedef syntax described above for External Types.

    +

    [Rust="record"]
    +typedef extern One;
    +
    +becomes +
    typedef record One;
    +

    diff --git a/next/bindings.html b/next/bindings.html index 58dbda1c2..792f96da8 100644 --- a/next/bindings.html +++ b/next/bindings.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/describing.html b/next/describing.html index 7312cace0..941941b24 100644 --- a/next/describing.html +++ b/next/describing.html @@ -872,6 +872,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/foreign_traits.html b/next/foreign_traits.html index bcc7d387a..0608b1825 100644 --- a/next/foreign_traits.html +++ b/next/foreign_traits.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/futures.html b/next/futures.html index 7cafcb9be..e2dd9e485 100644 --- a/next/futures.html +++ b/next/futures.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1729,7 +1750,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/index.html b/next/index.html index ba9c7aba4..87e279b43 100644 --- a/next/index.html +++ b/next/index.html @@ -856,6 +856,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1634,7 +1655,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/internals/async.html b/next/internals/async.html index 38f6a12e5..f5599b562 100644 --- a/next/internals/async.html +++ b/next/internals/async.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1740,7 +1761,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/internals/crates.html b/next/internals/crates.html index a37ef0be2..28f47d109 100644 --- a/next/internals/crates.html +++ b/next/internals/crates.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/internals/design_principles.html b/next/internals/design_principles.html index 830328e06..bbcb686c0 100644 --- a/next/internals/design_principles.html +++ b/next/internals/design_principles.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1725,7 +1746,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/internals/lifting_and_lowering.html b/next/internals/lifting_and_lowering.html index 125fb6c36..1878083a0 100644 --- a/next/internals/lifting_and_lowering.html +++ b/next/internals/lifting_and_lowering.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1707,7 +1728,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/internals/object_references.html b/next/internals/object_references.html index a80a866ff..683fe2367 100644 --- a/next/internals/object_references.html +++ b/next/internals/object_references.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1698,7 +1719,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/internals/rendering_foreign_bindings.html b/next/internals/rendering_foreign_bindings.html index 9c35c7df9..464def58e 100644 --- a/next/internals/rendering_foreign_bindings.html +++ b/next/internals/rendering_foreign_bindings.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1722,7 +1743,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/kotlin/configuration.html b/next/kotlin/configuration.html index b51131d8f..64d6ec759 100644 --- a/next/kotlin/configuration.html +++ b/next/kotlin/configuration.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1700,7 +1721,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/kotlin/gradle.html b/next/kotlin/gradle.html index 34c8e8a90..a270ae579 100644 --- a/next/kotlin/gradle.html +++ b/next/kotlin/gradle.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1727,7 +1748,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/kotlin/lifetimes.html b/next/kotlin/lifetimes.html index c4539254f..e574885e6 100644 --- a/next/kotlin/lifetimes.html +++ b/next/kotlin/lifetimes.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1691,7 +1712,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/docstrings.html b/next/proc_macro/docstrings.html index f0076ba3b..88e11b788 100644 --- a/next/proc_macro/docstrings.html +++ b/next/proc_macro/docstrings.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/enumerations.html b/next/proc_macro/enumerations.html index 5522a9f1f..d04de8163 100644 --- a/next/proc_macro/enumerations.html +++ b/next/proc_macro/enumerations.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1702,7 +1723,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/errors.html b/next/proc_macro/errors.html index 6376951ee..a92080d72 100644 --- a/next/proc_macro/errors.html +++ b/next/proc_macro/errors.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/functions.html b/next/proc_macro/functions.html index c5f2a9278..d1d272501 100644 --- a/next/proc_macro/functions.html +++ b/next/proc_macro/functions.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1706,7 +1727,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/index.html b/next/proc_macro/index.html index 67e267535..b9b6d3f4f 100644 --- a/next/proc_macro/index.html +++ b/next/proc_macro/index.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1745,7 +1766,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/interfaces.html b/next/proc_macro/interfaces.html index cbd7ef41e..2f7dc46b0 100644 --- a/next/proc_macro/interfaces.html +++ b/next/proc_macro/interfaces.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/proc_macro/records.html b/next/proc_macro/records.html index 74cd4421f..228df3d2d 100644 --- a/next/proc_macro/records.html +++ b/next/proc_macro/records.html @@ -862,6 +862,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/python/configuration.html b/next/python/configuration.html index dce42e7fb..636075282 100644 --- a/next/python/configuration.html +++ b/next/python/configuration.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1731,7 +1752,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/swift/configuration.html b/next/swift/configuration.html index 32a165a95..42f1af53f 100644 --- a/next/swift/configuration.html +++ b/next/swift/configuration.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1700,7 +1721,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/swift/module.html b/next/swift/module.html index cbb7399a8..47a87fb47 100644 --- a/next/swift/module.html +++ b/next/swift/module.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/swift/overview.html b/next/swift/overview.html index 3b94e1e00..c84c18183 100644 --- a/next/swift/overview.html +++ b/next/swift/overview.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1691,7 +1712,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/swift/uniffi-bindgen-swift.html b/next/swift/uniffi-bindgen-swift.html index 95caeec59..5b92af8d8 100644 --- a/next/swift/uniffi-bindgen-swift.html +++ b/next/swift/uniffi-bindgen-swift.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1691,7 +1712,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/swift/xcode.html b/next/swift/xcode.html index 7d89815b0..f59ed95c6 100644 --- a/next/swift/xcode.html +++ b/next/swift/xcode.html @@ -860,6 +860,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1709,7 +1730,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/tutorial/Prerequisites.html b/next/tutorial/Prerequisites.html index b00c02bf2..d958cd682 100644 --- a/next/tutorial/Prerequisites.html +++ b/next/tutorial/Prerequisites.html @@ -920,6 +920,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1698,7 +1719,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/tutorial/Rust_scaffolding.html b/next/tutorial/Rust_scaffolding.html index 9c7addf97..3b6be63c7 100644 --- a/next/tutorial/Rust_scaffolding.html +++ b/next/tutorial/Rust_scaffolding.html @@ -935,6 +935,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1713,7 +1734,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/tutorial/foreign_language_bindings.html b/next/tutorial/foreign_language_bindings.html index 8a4849007..7313e728b 100644 --- a/next/tutorial/foreign_language_bindings.html +++ b/next/tutorial/foreign_language_bindings.html @@ -968,6 +968,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1746,7 +1767,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x @@ -1886,10 +1907,12 @@

    Creating the bindgen binary

    You can now run uniffi-bindgen from your project using cargo run --features=uniffi/cli --bin uniffi-bindgen [args]

    Multi-crate workspaces

    -

    In a multiple crates workspace, you can create a separate crate for running uniffi-bindgen: - - Name the crate uniffi-bindgen, add it to your workspace. - - Add this dependency to Cargo.toml: uniffi = {version = "0.XX.0", features = ["cli"] } - - As above, add the uniffi-bindgen binary target

    +

    In a multiple crates workspace, you can create a separate crate for running uniffi-bindgen:

    +
      +
    • Name the crate uniffi-bindgen, add it to your workspace.
    • +
    • Add this dependency to Cargo.toml: uniffi = {version = "0.XX.0", features = ["cli"] }
    • +
    • As above, add the uniffi-bindgen binary target
    • +

    Then your can run uniffi-bindgen from any crate in your project using cargo run -p uniffi-bindgen [args]

    Running uniffi-bindgen using a library file

    Use generate --library to generate foreign bindings by using a cdylib file built for your library. @@ -1902,12 +1925,14 @@

    Running uniffi-bindgen usin (maybe .dylib, good luck with .dll!)

    Then look in the out directory.

    When using library mode, if multiple crates get built into the library that use UniFFI, all will have bindings generated for them.

    -

    Library mode comes with some extra requirements: - - It must be run from within the cargo workspace of your project - - Each crate must use exactly 1 UDL file when compiling the Rust library. However, crates can have +

    Library mode comes with some extra requirements:

    +
      +
    • It must be run from within the cargo workspace of your project
    • +
    • Each crate must use exactly 1 UDL file when compiling the Rust library. However, crates can have multiple UDL files as long as they ensure only one is used for any particular build, - e.g. by using feature flags. - - Rust sources must use uniffi::include_scaffolding! to include the scaffolding code.

      + e.g. by using feature flags.
    • +
    • Rust sources must use uniffi::include_scaffolding! to include the scaffolding code.
    • +

    Running uniffi-bindgen with a single UDL file

    As noted above, library mode is encouraged - building from a single UDL is not recommended.

    Use the generate command to generate bindings by specifying a UDL file.

    diff --git a/next/tutorial/udl_file.html b/next/tutorial/udl_file.html index d7b3f64b7..7b9673dd9 100644 --- a/next/tutorial/udl_file.html +++ b/next/tutorial/udl_file.html @@ -920,6 +920,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1698,7 +1719,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/builtin_types.html b/next/types/builtin_types.html index 2ad4f7f33..4953800c1 100644 --- a/next/types/builtin_types.html +++ b/next/types/builtin_types.html @@ -872,6 +872,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/callback_interfaces.html b/next/types/callback_interfaces.html index c51690948..296ce875c 100644 --- a/next/types/callback_interfaces.html +++ b/next/types/callback_interfaces.html @@ -935,6 +935,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1713,7 +1734,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/custom_types.html b/next/types/custom_types.html index b03406887..a49ec2f34 100644 --- a/next/types/custom_types.html +++ b/next/types/custom_types.html @@ -1010,6 +1010,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1788,7 +1809,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/enumerations.html b/next/types/enumerations.html index 0e5bfdec0..b64689f8f 100644 --- a/next/types/enumerations.html +++ b/next/types/enumerations.html @@ -920,6 +920,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1698,7 +1719,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/errors.html b/next/types/errors.html index 172a4fae0..761fa1857 100644 --- a/next/types/errors.html +++ b/next/types/errors.html @@ -913,6 +913,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1691,7 +1712,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/functions.html b/next/types/functions.html index cfa0ccaa9..966a91f9a 100644 --- a/next/types/functions.html +++ b/next/types/functions.html @@ -922,6 +922,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1700,7 +1721,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/interfaces.html b/next/types/interfaces.html index 81ecf1eb6..a09d62a8c 100644 --- a/next/types/interfaces.html +++ b/next/types/interfaces.html @@ -980,6 +980,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1758,7 +1779,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/namespace.html b/next/types/namespace.html index c4ef2dc49..41d23c203 100644 --- a/next/types/namespace.html +++ b/next/types/namespace.html @@ -872,6 +872,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/records.html b/next/types/records.html index f616d8a5c..c6b06696d 100644 --- a/next/types/records.html +++ b/next/types/records.html @@ -872,6 +872,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/types/remote_ext_types.html b/next/types/remote_ext_types.html index 213a1a4f4..52aa857a1 100644 --- a/next/types/remote_ext_types.html +++ b/next/types/remote_ext_types.html @@ -872,6 +872,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1650,7 +1671,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x @@ -1756,6 +1777,7 @@

    UDL

  • Records: record, dictionary or struct
  • Objects: object, impl or interface
  • Traits: trait, callback or trait_with_foreign
  • +
  • Custom types: custom
  • Special cases for remote types

    There are a few cases where remote types require extra handling in addition to the rules above.

    diff --git a/next/udl/docstrings.html b/next/udl/docstrings.html index 449e7720d..f742f6c89 100644 --- a/next/udl/docstrings.html +++ b/next/udl/docstrings.html @@ -9,7 +9,7 @@ - + @@ -862,6 +862,27 @@ + + +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + @@ -1718,7 +1739,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/udl/enumerations.html b/next/udl/enumerations.html index 87f7d034e..49ea6f67a 100644 --- a/next/udl/enumerations.html +++ b/next/udl/enumerations.html @@ -922,6 +922,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1700,7 +1721,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/udl/errors.html b/next/udl/errors.html index a78425dc4..3814a7d07 100644 --- a/next/udl/errors.html +++ b/next/udl/errors.html @@ -874,6 +874,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/udl/external_types.html b/next/udl/external_types.html new file mode 100644 index 000000000..3b6a7744b --- /dev/null +++ b/next/udl/external_types.html @@ -0,0 +1,1799 @@ + + + + + + + + + + + + + + + + + + + + + + + Using types defined outside a UDL. - The UniFFI user guide + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + Skip to content + + +
    +
    + +
    + + + + + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + +

    Using types defined outside a UDL.

    +

    Often you need to refer to types described outside of this UDL - they +may be defined in a proc-macro in this crate or defined in an external crate.

    +

    You declare such types using: +

    typedef [type] [TypeName];
    +
    +TypeName is then able to be used as a normal type in this UDL (ie, be returned from functions, in records, etc)

    +

    type indicates the actual type of TypeName and can be any of the following values: +* "enum" for Enums. +* "record", "dictionary" or "struct" for Records. +* "object", "impl" or "interface" for objects. +* "trait", "callback" or "trait_with_foreign" for traits. +* "custom" for Custom Types.

    +

    for example, if this crate has: +

    #[derive(::uniffi::Object)]
    +struct MyObject { ... }
    +
    +our UDL could use this type with: +
    typedef interface MyObject;
    +

    +

    External Crates

    +

    The [External="crate_name"] attribute can be used whenever the type is in another crate - whether in UDL or in a proc-macro.

    +
    [External = "other_crate"]
    +typedef interface OtherObject;
    +
    + + + + + + + + + + + + + +
    +
    + + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/next/udl/functions.html b/next/udl/functions.html index 520fbce28..6691c21e3 100644 --- a/next/udl/functions.html +++ b/next/udl/functions.html @@ -922,6 +922,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1700,7 +1721,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/udl/index.html b/next/udl/index.html index 0f31410f7..f7eb84de2 100644 --- a/next/udl/index.html +++ b/next/udl/index.html @@ -874,6 +874,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/udl/interfaces.html b/next/udl/interfaces.html index 2a1d1a8ff..b1c1b6b81 100644 --- a/next/udl/interfaces.html +++ b/next/udl/interfaces.html @@ -946,6 +946,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1724,7 +1745,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x diff --git a/next/udl/records.html b/next/udl/records.html index 4c4afda80..2b87d6bb8 100644 --- a/next/udl/records.html +++ b/next/udl/records.html @@ -12,7 +12,7 @@ - + @@ -874,6 +874,27 @@ +
  • + + + + + Using types defined outside a UDL. + + + + +
  • + + + + + + + + + +
  • @@ -1652,7 +1673,7 @@ - v0.28.x -> v0.29.x + Upgrading v0.28.x -> v0.29.x