#[repr(C)]pub struct RegisterComponentFn {
pub cb: RegisterComponentFnType,
pub ctx: OptionRefAny,
}Expand description
Callback struct for registering individual components at startup.
In C: pass a bare extern "C" fn() -> ComponentDef function pointer —
it converts automatically via From<RegisterComponentFnType>.
In Python: construct this struct with cb set to a trampoline and
ctx set to Some(RefAny(...)) wrapping the Python callable.
Fields§
§cb: RegisterComponentFnType§ctx: OptionRefAnyFor FFI: stores the foreign callable (e.g., PyFunction). Native Rust/C code sets this to None.
Trait Implementations§
Source§impl Clone for RegisterComponentFn
impl Clone for RegisterComponentFn
Source§impl Debug for RegisterComponentFn
impl Debug for RegisterComponentFn
Source§impl Display for RegisterComponentFn
impl Display for RegisterComponentFn
Source§impl From<extern "C" fn() -> ComponentDef> for RegisterComponentFn
Allow creating callback from a raw function pointer
Sets callable to None (for native Rust/C usage)
impl From<extern "C" fn() -> ComponentDef> for RegisterComponentFn
Allow creating callback from a raw function pointer Sets callable to None (for native Rust/C usage)
Source§fn from(cb: RegisterComponentFnType) -> Self
fn from(cb: RegisterComponentFnType) -> Self
Converts to this type from the input type.
Source§impl Hash for RegisterComponentFn
impl Hash for RegisterComponentFn
Source§impl Ord for RegisterComponentFn
impl Ord for RegisterComponentFn
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RegisterComponentFn
impl PartialEq for RegisterComponentFn
Source§impl PartialOrd for RegisterComponentFn
impl PartialOrd for RegisterComponentFn
impl Eq for RegisterComponentFn
Auto Trait Implementations§
impl Freeze for RegisterComponentFn
impl RefUnwindSafe for RegisterComponentFn
impl Send for RegisterComponentFn
impl Sync for RegisterComponentFn
impl Unpin for RegisterComponentFn
impl UnsafeUnpin for RegisterComponentFn
impl UnwindSafe for RegisterComponentFn
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