Struct uniffi_bindgen::interface::function::Function
source · pub struct Function {
pub(super) name: String,
pub(super) module_path: String,
pub(super) is_async: bool,
pub(super) arguments: Vec<Argument>,
pub(super) return_type: Option<Type>,
pub(super) ffi_func: FfiFunction,
pub(super) docstring: Option<String>,
pub(super) throws: Option<Type>,
pub(super) checksum_fn_name: String,
pub(super) checksum: Option<u16>,
}
Expand description
Represents a standalone function.
Each Function
corresponds to a standalone function in the rust module,
and has a corresponding standalone function in the foreign language bindings.
In the FFI, this will be a standalone function with appropriately lowered types.
Fields§
§name: String
§module_path: String
§is_async: bool
§arguments: Vec<Argument>
§return_type: Option<Type>
§ffi_func: FfiFunction
§docstring: Option<String>
§throws: Option<Type>
§checksum_fn_name: String
§checksum: Option<u16>
Implementations§
source§impl Function
impl Function
pub fn name(&self) -> &str
pub fn is_async(&self) -> bool
pub fn arguments(&self) -> Vec<&Argument>
pub fn full_arguments(&self) -> Vec<Argument>
pub fn return_type(&self) -> Option<&Type>
pub fn ffi_func(&self) -> &FfiFunction
pub fn checksum_fn_name(&self) -> &str
pub fn checksum(&self) -> u16
pub fn throws(&self) -> bool
pub fn throws_name(&self) -> Option<&str>
pub fn throws_type(&self) -> Option<&Type>
pub fn derive_ffi_func(&mut self) -> Result<()>
pub fn iter_types(&self) -> TypeIterator<'_>
pub fn docstring(&self) -> Option<&str>
Trait Implementations§
source§impl Callable for Function
impl Callable for Function
fn arguments(&self) -> Vec<&Argument>
fn return_type(&self) -> Option<Type>
fn throws_type(&self) -> Option<Type>
fn is_async(&self) -> bool
fn takes_self(&self) -> bool
fn result_type(&self) -> ResultType
fn ffi_rust_future_poll(&self, ci: &ComponentInterface) -> String
fn ffi_rust_future_cancel(&self, ci: &ComponentInterface) -> String
fn ffi_rust_future_complete(&self, ci: &ComponentInterface) -> String
fn ffi_rust_future_free(&self, ci: &ComponentInterface) -> String
Auto Trait Implementations§
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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