Skip to main content

MethodDesc

Struct MethodDesc 

Source
#[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: FfiStr

Method name as seen from generic code (e.g. "__init__", "value").

§arities: *const u8

Accepted 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: usize

Number 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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.