pub struct Function { /* private fields */ }
Expand description
Error reference class
Implementations§
Source§impl Function
impl Function
Sourcepub fn call_packed(&self, packed_args: &[AnyView<'_>]) -> Result<Any>
pub fn call_packed(&self, packed_args: &[AnyView<'_>]) -> Result<Any>
Call the function in packed format.
pub fn call_tuple<TupleType>(&self, tuple_args: TupleType) -> Result<Any>where
TupleType: TupleAsPackedArgs,
Sourcepub fn call_tuple_with_len<const LEN: usize, TupleType>(
&self,
tuple_args: TupleType,
) -> Result<Any>where
TupleType: TupleAsPackedArgs,
pub fn call_tuple_with_len<const LEN: usize, TupleType>(
&self,
tuple_args: TupleType,
) -> Result<Any>where
TupleType: TupleAsPackedArgs,
Sourcepub fn get_global(name: &str) -> Result<Function>
pub fn get_global(name: &str) -> Result<Function>
Sourcepub fn from_packed<F>(func: F) -> Self
pub fn from_packed<F>(func: F) -> Self
Sourcepub fn from_typed<F, I, O>(func: F) -> Selfwhere
F: AsPackedCallable<I, O> + 'static,
pub fn from_typed<F, I, O>(func: F) -> Selfwhere
F: AsPackedCallable<I, O> + 'static,
pub fn from_extern_c( handle: *mut c_void, safe_call: TVMFFISafeCallType, deleter: Option<unsafe extern "C" fn(*mut c_void)>, ) -> Self
Trait Implementations§
Source§impl AnyCompatible for Function
impl AnyCompatible for Function
Source§unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
the value to copy to TVMFFIAny
unsafe fn check_any_strict(data: &TVMFFIAny) -> bool
Source§unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
Copy value from TVMFFIAny after checking
caller must ensure that the value is compatible with the type
Source§unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
consume the value to move to Any
Source§unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
the value to move from TVMFFIAny
NOTE: pay very careful attention to avoid memory leak! Read more
Source§unsafe fn try_cast_from_any_view(data: &TVMFFIAny) -> Result<Self, ()>
unsafe fn try_cast_from_any_view(data: &TVMFFIAny) -> Result<Self, ()>
try to cast the value from AnyView
Source§fn get_mismatch_type_info(data: &TVMFFIAny) -> String
fn get_mismatch_type_info(data: &TVMFFIAny) -> String
Get the type key of a type when TryCastFromAnyView fails.
Source§impl<'a> ArgIntoRef for &'a Function
impl<'a> ArgIntoRef for &'a Function
Source§impl ArgIntoRef for Function
impl ArgIntoRef for Function
Source§impl<'a> IntoArgHolder for &'a Function
impl<'a> IntoArgHolder for &'a Function
Source§impl IntoArgHolder for Function
impl IntoArgHolder for Function
Source§impl ObjectRefCore for Function
impl ObjectRefCore for Function
type ContainerType = <ObjectArc<FunctionObj> as Deref>::Target
fn data(this: &Self) -> &ObjectArc<Self::ContainerType>
fn into_data(this: Self) -> ObjectArc<Self::ContainerType>
fn from_data(data: ObjectArc<Self::ContainerType>) -> Self
Auto Trait Implementations§
impl Freeze for Function
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