Function uniffi_bindgen::interface::get_callback_interface
source · fn get_callback_interface<'a>(
+get_callback_interface in uniffi_bindgen::interface - Rust Function uniffi_bindgen::interface::get_callback_interface
source · fn get_callback_interface<'a>(
callback_interfaces: &'a mut [CallbackInterface],
name: &str
) -> Option<&'a mut CallbackInterface>
\ No newline at end of file
diff --git a/internals/api/uniffi_bindgen/interface/fn.get_object.html b/internals/api/uniffi_bindgen/interface/fn.get_object.html
index d1782e0b4c..66e62347a3 100644
--- a/internals/api/uniffi_bindgen/interface/fn.get_object.html
+++ b/internals/api/uniffi_bindgen/interface/fn.get_object.html
@@ -1,4 +1,4 @@
-get_object in uniffi_bindgen::interface - Rust Function uniffi_bindgen::interface::get_object
source · fn get_object<'a>(
+get_object in uniffi_bindgen::interface - Rust Function uniffi_bindgen::interface::get_object
source · fn get_object<'a>(
objects: &'a mut [Object],
name: &str
) -> Option<&'a mut Object>
\ No newline at end of file
diff --git a/internals/api/uniffi_bindgen/interface/fn.throws_name.html b/internals/api/uniffi_bindgen/interface/fn.throws_name.html
index 7fe23ba13b..30cfb9909f 100644
--- a/internals/api/uniffi_bindgen/interface/fn.throws_name.html
+++ b/internals/api/uniffi_bindgen/interface/fn.throws_name.html
@@ -1 +1 @@
-throws_name in uniffi_bindgen::interface - Rust Function uniffi_bindgen::interface::throws_name
source · fn throws_name(throws: &Option<Type>) -> Option<&str>
\ No newline at end of file
+throws_name in uniffi_bindgen::interface - Rust Function uniffi_bindgen::interface::throws_name
source · fn throws_name(throws: &Option<Type>) -> Option<&str>
\ No newline at end of file
diff --git a/internals/api/uniffi_bindgen/interface/index.html b/internals/api/uniffi_bindgen/interface/index.html
index 38dbc40264..c27afb1825 100644
--- a/internals/api/uniffi_bindgen/interface/index.html
+++ b/internals/api/uniffi_bindgen/interface/index.html
@@ -1,4 +1,4 @@
-uniffi_bindgen::interface - Rust Module uniffi_bindgen::interface
source · Expand description
Component Interface Definition.
+uniffi_bindgen::interface - Rust Module uniffi_bindgen::interface
source · Expand description
Component Interface Definition.
This module provides an abstract representation of the interface provided by a UniFFI Rust Component,
in high-level terms suitable for translation into target consumer languages such as Kotlin
and Swift. It also provides facilities for parsing a WebIDL interface definition file into such a
diff --git a/internals/api/uniffi_bindgen/interface/struct.ComponentInterface.html b/internals/api/uniffi_bindgen/interface/struct.ComponentInterface.html
index 3bb28e4aee..01b5e4cc92 100644
--- a/internals/api/uniffi_bindgen/interface/struct.ComponentInterface.html
+++ b/internals/api/uniffi_bindgen/interface/struct.ComponentInterface.html
@@ -11,7 +11,7 @@
by a rust component and the details of consuming it via an extern-C FFI layer.
Fields§
§types: TypeUniverse
All of the types used in the interface.
§enums: BTreeMap<String, Enum>
The high-level API provided by the component.
-§records: BTreeMap<String, Record>
§functions: Vec<Function>
§objects: Vec<Object>
§callback_interfaces: Vec<CallbackInterface>
§errors: HashSet<String>
§callback_interface_throws_types: BTreeSet<Type>
Implementations§
source§impl ComponentInterface
sourcepub fn new(crate_name: &str) -> Self
sourcepub fn from_webidl(idl: &str, module_path: &str) -> Result<Self>
Parse a ComponentInterface
from a string containing a WebIDL definition.
+§records: BTreeMap<String, Record>
§functions: Vec<Function>
§objects: Vec<Object>
§callback_interfaces: Vec<CallbackInterface>
§errors: HashSet<String>
§callback_interface_throws_types: BTreeSet<Type>
Implementations§
source§impl ComponentInterface
sourcepub fn new(crate_name: &str) -> Self
sourcepub fn from_webidl(idl: &str, module_path: &str) -> Result<Self>
Parse a ComponentInterface
from a string containing a WebIDL definition.
sourcepub fn from_metadata(group: MetadataGroup) -> Result<Self>
Create a ComponentInterface
from a MetadataGroup
Public so that external binding generators can use it.
sourcepub fn add_metadata(&mut self, group: MetadataGroup) -> Result<()>
Add a metadata group to a ComponentInterface
.
@@ -50,61 +50,61 @@
This method uses iter_types
to iterate over the types contained within the given type,
but additionally recurses into the definition of user-defined types like records and enums
to yield the types that they contain.
-sourcepub fn item_contains_object_references(&self, item: &Type) -> bool
Check whether the given item contains any (possibly nested) Type::Object references.
+sourcepub fn item_contains_object_references(&self, item: &Type) -> bool
Check whether the given item contains any (possibly nested) Type::Object references.
This is important to know in language bindings that cannot integrate object types
tightly with the host GC, and hence need to perform manual destruction of objects.
-sourcepub fn item_contains_unsigned_types(&self, item: &Type) -> bool
Check whether the given item contains any (possibly nested) unsigned types
-sourcepub fn contains_optional_types(&self) -> bool
Check whether the interface contains any optional types
-sourcepub fn contains_sequence_types(&self) -> bool
Check whether the interface contains any sequence types
-sourcepub fn contains_map_types(&self) -> bool
Check whether the interface contains any map types
-sourcefn ffi_namespace(&self) -> &str
sourcepub fn ffi_uniffi_contract_version(&self) -> FfiFunction
Builtin FFI function to get the current contract version
+
sourcepub fn item_contains_unsigned_types(&self, item: &Type) -> bool
Check whether the given item contains any (possibly nested) unsigned types
+sourcepub fn contains_optional_types(&self) -> bool
Check whether the interface contains any optional types
+sourcepub fn contains_sequence_types(&self) -> bool
Check whether the interface contains any sequence types
+sourcepub fn contains_map_types(&self) -> bool
Check whether the interface contains any map types
+sourcefn ffi_namespace(&self) -> &str
sourcepub fn ffi_uniffi_contract_version(&self) -> FfiFunction
Builtin FFI function to get the current contract version
This is needed so that the foreign language bindings can check that they are using the same
ABI as the scaffolding
-sourcepub fn ffi_rustbuffer_alloc(&self) -> FfiFunction
Builtin FFI function for allocating a new RustBuffer
.
+
sourcepub fn ffi_rustbuffer_alloc(&self) -> FfiFunction
Builtin FFI function for allocating a new RustBuffer
.
This is needed so that the foreign language bindings can create buffers in which to pass
complex data types across the FFI.
-sourcepub fn ffi_rustbuffer_from_bytes(&self) -> FfiFunction
Builtin FFI function for copying foreign-owned bytes
+
sourcepub fn ffi_rustbuffer_from_bytes(&self) -> FfiFunction
Builtin FFI function for copying foreign-owned bytes
This is needed so that the foreign language bindings can create buffers in which to pass
complex data types across the FFI.
-sourcepub fn ffi_rustbuffer_free(&self) -> FfiFunction
Builtin FFI function for freeing a RustBuffer
.
+
sourcepub fn ffi_rustbuffer_free(&self) -> FfiFunction
Builtin FFI function for freeing a RustBuffer
.
This is needed so that the foreign language bindings can free buffers in which they received
complex data types returned across the FFI.
-sourcepub fn ffi_rustbuffer_reserve(&self) -> FfiFunction
Builtin FFI function for reserving extra space in a RustBuffer
.
+
sourcepub fn ffi_rustbuffer_reserve(&self) -> FfiFunction
Builtin FFI function for reserving extra space in a RustBuffer
.
This is needed so that the foreign language bindings can grow buffers used for passing
complex data types across the FFI.
-sourcepub fn ffi_rust_future_poll(
+
sourcepub fn ffi_rust_future_poll(
&self,
return_ffi_type: Option<FfiType>
) -> FfiFunction
Builtin FFI function to poll a Rust future.
-sourcepub fn ffi_rust_future_complete(
+
sourcepub fn ffi_rust_future_complete(
&self,
return_ffi_type: Option<FfiType>
) -> FfiFunction
Builtin FFI function to complete a Rust future and get it’s result.
We generate one of these for each FFI return type.
-sourcepub fn ffi_rust_future_cancel(
+
sourcepub fn ffi_rust_future_cancel(
&self,
return_ffi_type: Option<FfiType>
) -> FfiFunction
Builtin FFI function for cancelling a Rust Future
-sourcepub fn ffi_rust_future_free(
+
sourcepub fn ffi_rust_future_free(
&self,
return_ffi_type: Option<FfiType>
) -> FfiFunction
Builtin FFI function for freeing a Rust Future
-sourcefn rust_future_ffi_fn_name(
+
sourcefn rust_future_ffi_fn_name(
&self,
base_name: &str,
return_ffi_type: Option<FfiType>
-) -> String
sourcepub fn has_async_fns(&self) -> bool
Does this interface contain async functions?
-sourcepub fn iter_future_callback_params(&self) -> impl Iterator<Item = FfiType>
Iterate over T
parameters of the FutureCallback<T>
callbacks in this interface
-sourcepub fn iter_async_result_types(&self) -> impl Iterator<Item = ResultType>
Iterate over return/throws types for async functions
-sourcepub fn iter_ffi_function_definitions(
+) -> String
sourcepub fn has_async_fns(&self) -> bool
Does this interface contain async functions?
+sourcepub fn iter_future_callback_params(&self) -> impl Iterator<Item = FfiType>
Iterate over T
parameters of the FutureCallback<T>
callbacks in this interface
+sourcepub fn iter_async_result_types(&self) -> impl Iterator<Item = ResultType>
Iterate over return/throws types for async functions
+sourcepub fn iter_ffi_function_definitions(
&self
) -> impl Iterator<Item = FfiFunction> + '_
List the definitions of all FFI functions in the interface.
The set of FFI functions is derived automatically from the set of higher-level types
along with the builtin FFI helper functions.
-
sourcepub fn iter_ffi_function_definitions_non_async(
&self
) -> impl Iterator<Item = FfiFunction> + '_
Alternate version of iter_ffi_function_definitions for languages that don’t support async
-sourcepub fn iter_user_ffi_function_definitions(
+
sourcepub fn iter_user_ffi_function_definitions(
&self
) -> impl Iterator<Item = &FfiFunction> + '_
List all FFI functions definitions for user-defined interfaces
This includes FFI functions for:
@@ -113,40 +113,40 @@
Object methods
Callback interfaces
-
sourcepub fn iter_rust_buffer_ffi_function_definitions(
&self
) -> impl Iterator<Item = FfiFunction>
List all FFI functions definitions for RustBuffer functionality.
-