Struct uniffi_bindgen::interface::ffi::FfiFunction
source · pub struct FfiFunction {
pub(super) name: String,
pub(super) is_async: bool,
pub(super) arguments: Vec<FfiArgument>,
pub(super) return_type: Option<FfiType>,
pub(super) has_rust_call_status_arg: bool,
pub(super) is_object_free_function: bool,
}
Expand description
Represents an “extern C”-style function that will be part of the FFI.
These can’t be declared explicitly in the UDL, but rather, are derived automatically
from the high-level interface. Each callable thing in the component API will have a
corresponding FfiFunction
through which it can be invoked, and UniFFI also provides
some built-in FfiFunction
helpers for use in the foreign language bindings.
Fields§
§name: String
§is_async: bool
§arguments: Vec<FfiArgument>
§return_type: Option<FfiType>
§has_rust_call_status_arg: bool
§is_object_free_function: bool
Used by C# generator to differentiate the free function and call it with void*
instead of C# SafeHandle
type. See https://github.com/mozilla/uniffi-rs/pull/1488.
Implementations§
source§impl FfiFunction
impl FfiFunction
pub fn callback_init( module_path: &str, trait_name: &str, vtable_name: String ) -> Self
pub fn name(&self) -> &str
pub fn is_async(&self) -> bool
pub fn arguments(&self) -> Vec<&FfiArgument>
pub fn return_type(&self) -> Option<&FfiType>
pub fn has_rust_call_status_arg(&self) -> bool
pub fn is_object_free_function(&self) -> bool
pub fn init( &mut self, return_type: Option<FfiType>, args: impl IntoIterator<Item = FfiArgument> )
Trait Implementations§
source§impl Clone for FfiFunction
impl Clone for FfiFunction
source§fn clone(&self) -> FfiFunction
fn clone(&self) -> FfiFunction
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FfiFunction
impl Debug for FfiFunction
source§impl Default for FfiFunction
impl Default for FfiFunction
source§impl From<FfiFunction> for FfiDefinition
impl From<FfiFunction> for FfiDefinition
source§fn from(value: FfiFunction) -> FfiDefinition
fn from(value: FfiFunction) -> FfiDefinition
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for FfiFunction
impl Send for FfiFunction
impl Sync for FfiFunction
impl Unpin for FfiFunction
impl UnwindSafe for FfiFunction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more