Module uniffi_bindgen::interface::function
source · Expand description
Function definitions for a ComponentInterface
.
This module converts function definitions from UDL into structures that
can be added to a ComponentInterface
. A declaration in the UDL like this:
namespace example {
string hello();
};
Will result in a Function
member being added to the resulting crate::ComponentInterface
:
let func = ci.get_function_definition("hello").unwrap();
assert_eq!(func.name(), "hello");
assert!(matches!(func.return_type(), Some(Type::String)));
assert_eq!(func.arguments().len(), 0);
Structs
- Represents an argument to a function/constructor/method call.
- Represents a standalone function.
- Combines the return and throws type of a function/method
Traits
- Implemented by function-like types (Function, Method, Constructor)