#[repr(C)]pub struct RegisterComponentFn {
pub cb: extern "C" fn() -> ComponentDef,
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: extern "C" fn() -> ComponentDef§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§fn clone(&self) -> RegisterComponentFn
fn clone(&self) -> RegisterComponentFn
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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: extern "C" fn() -> ComponentDef) -> RegisterComponentFn
fn from(cb: extern "C" fn() -> ComponentDef) -> RegisterComponentFn
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
Source§fn cmp(&self, other: &RegisterComponentFn) -> Ordering
fn cmp(&self, other: &RegisterComponentFn) -> Ordering
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§fn eq(&self, rhs: &RegisterComponentFn) -> bool
fn eq(&self, rhs: &RegisterComponentFn) -> bool
Tests for
self and other values to be equal, and is used by ==.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more