Skip to main content

ClassDesc

Struct ClassDesc 

Source
#[repr(C)]
pub struct ClassDesc { pub name: FfiStr, pub methods: *const MethodDesc, pub methods_len: usize, pub drop: Option<extern "C" fn(opaque_ptr: *mut c_void)>, pub traverse: Option<extern "C" fn(opaque_ptr: *mut c_void, visit: PluginVisitFn, visit_ctx: *mut c_void) -> i32>, }
Expand description

Description of a plugin-defined class; one entry per class in ModuleDesc::classes.

Fields§

§name: FfiStr

Class name as seen from generic code (e.g. "Counter").

§methods: *const MethodDesc

Pointer to methods_len contiguous MethodDesc entries.

§methods_len: usize

Number of entries in methods.

§drop: Option<extern "C" fn(opaque_ptr: *mut c_void)>

Destructor for the plugin’s opaque per-instance state, called by the host with the *mut c_void installed via instance_set_opaque when a plugin-backed instance is garbage-collected. May be null if the plugin manages the lifetime itself (rare).

§traverse: Option<extern "C" fn(opaque_ptr: *mut c_void, visit: PluginVisitFn, visit_ctx: *mut c_void) -> i32>

GC traversal callback, called during the mark phase for each live plugin-backed instance. May be null if the opaque struct holds no GenericValues. This is PluginTraverseFn 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.