#[repr(C)]pub struct CoreCallback {
pub cb: CoreCallbackType,
pub ctx: OptionRefAny,
}Expand description
Stores a callback as usize (actually a function pointer cast to usize)
IMPORTANT: The cb field stores a function pointer disguised as usize to avoid
circular dependencies between azul-core and azul-layout. When creating a CoreCallback,
you can directly assign a function pointer - Rust will implicitly cast it to usize.
When invoking, the usize must be unsafely cast back to the function pointer type.
Must return an Update that denotes if the screen should be redrawn.
Fields§
§cb: CoreCallbackType§ctx: OptionRefAnyFor FFI: stores the foreign callable (e.g., PyFunction) Native Rust code sets this to None
Trait Implementations§
Source§impl Clone for CoreCallback
impl Clone for CoreCallback
Source§fn clone(&self) -> CoreCallback
fn clone(&self) -> CoreCallback
Returns a duplicate of the value. Read more
1.0.0 · 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 CoreCallback
impl Debug for CoreCallback
Source§impl From<usize> for CoreCallback
Allow creating CoreCallback from a raw function pointer (as usize)
Sets callable to None (for native Rust/C usage)
impl From<usize> for CoreCallback
Allow creating CoreCallback from a raw function pointer (as usize) Sets callable to None (for native Rust/C usage)
Source§fn from(cb: CoreCallbackType) -> Self
fn from(cb: CoreCallbackType) -> Self
Converts to this type from the input type.
Source§impl Hash for CoreCallback
impl Hash for CoreCallback
Source§impl Ord for CoreCallback
impl Ord for CoreCallback
Source§fn cmp(&self, other: &CoreCallback) -> Ordering
fn cmp(&self, other: &CoreCallback) -> Ordering
1.21.0 · 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 CoreCallback
impl PartialEq for CoreCallback
Source§impl PartialOrd for CoreCallback
impl PartialOrd for CoreCallback
impl Eq for CoreCallback
impl StructuralPartialEq for CoreCallback
Auto Trait Implementations§
impl Freeze for CoreCallback
impl RefUnwindSafe for CoreCallback
impl Send for CoreCallback
impl Sync for CoreCallback
impl Unpin for CoreCallback
impl UnwindSafe for CoreCallback
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<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