#[repr(C)]pub struct MethodDesc {
pub name: FfiStr,
pub arities: *const u8,
pub arities_len: usize,
pub fun: Option<extern "C" fn(host: *const HostApi, receiver: GenericValue, args: *const GenericValue, nargs: usize) -> FfiReturn>,
}Expand description
Description of one method of a plugin-defined class.
Fields§
§name: FfiStrMethod name as seen from generic code (e.g. "__init__", "value").
arities: *const u8Accepted argument counts, excluding the receiver (the host checks
arity before calling). A method called as obj.foo(a, b) declares
&[2]; a receiver-only method declares &[0].
arities_len: usizeNumber of entries in arities.
fun: Option<extern "C" fn(host: *const HostApi, receiver: GenericValue, args: *const GenericValue, nargs: usize) -> FfiReturn>The method implementation; a null pointer is rejected at load. This is
PluginMethodFn spelled out inline - cbindgen only renders a nullable
C function pointer for an inline Option<fn>, not through the alias.
Auto Trait Implementations§
impl !Send for MethodDesc
impl !Sync for MethodDesc
impl Freeze for MethodDesc
impl RefUnwindSafe for MethodDesc
impl Unpin for MethodDesc
impl UnsafeUnpin for MethodDesc
impl UnwindSafe for MethodDesc
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