pub struct NativeEvent { /* private fields */ }Expand description
A platform listener firing for one component slot, as the generic listener
glue delivers it: a primitive (kind, detail) pair, never an allocation on
the hot path.
This bypasses RenderRoot::event entirely (the crate doc): it is a
platform interaction surfacing as a callback on the main thread, not a
frust pointer event — there is no EventCtx, no capture, no focus, and no
fire-on-up-inside semantics unless the platform control itself has them.
Implementations§
Source§impl NativeEvent
impl NativeEvent
Sourcepub const KIND_CLICK: i32 = EVENT_KIND_CLICK
pub const KIND_CLICK: i32 = EVENT_KIND_CLICK
A click / tap (ListenerKinds::CLICK); detail unused (0).
Sourcepub const KIND_TOGGLED: i32 = EVENT_KIND_TOGGLED
pub const KIND_TOGGLED: i32 = EVENT_KIND_TOGGLED
A two-state control flipped (ListenerKinds::TOGGLED); the new
state is Self::checked.
Sourcepub const KIND_VALUE_CHANGED: i32 = EVENT_KIND_VALUE_CHANGED
pub const KIND_VALUE_CHANGED: i32 = EVENT_KIND_VALUE_CHANGED
A ranged control moved (ListenerKinds::VALUE_CHANGED); the new
position is Self::value.
Sourcepub const KIND_DRAG_START: i32 = EVENT_KIND_DRAG_START
pub const KIND_DRAG_START: i32 = EVENT_KIND_DRAG_START
A ranged control’s drag began (Android and iOS only); detail unused.
Sourcepub const KIND_DRAG_END: i32 = EVENT_KIND_DRAG_END
pub const KIND_DRAG_END: i32 = EVENT_KIND_DRAG_END
A ranged control’s drag ended (Android and iOS only); detail unused.
Sourcepub fn kind(self) -> i32
pub fn kind(self) -> i32
Which listener fired — one of the KIND_* codes above, which are
crate::events’ wire codes, shared verbatim with Android’s listener.
Sourcepub fn is_click(self) -> bool
pub fn is_click(self) -> bool
Whether this is a Self::KIND_CLICK.
Sourcepub fn checked(self) -> Option<bool>
pub fn checked(self) -> Option<bool>
The reported checked state of a Self::KIND_TOGGLED; None for
any other kind.
Sourcepub fn value(self) -> Option<i32>
pub fn value(self) -> Option<i32>
The reported position of a Self::KIND_VALUE_CHANGED, in the
platform’s own space (a SeekBar’s zero-based progress, a
UISlider’s/NSSlider’s value rounded to the nearest integer) —
mapping it into an app range is the component’s job, since only it
configured the control’s range. None for any other kind.
Sourcepub fn family(self) -> ListenerKinds
pub fn family(self) -> ListenerKinds
The ListenerKinds family whose attach delivers this kind — what the
bridge checks a slot attached before delivering (the module doc’s
Listener attachment); ListenerKinds::NONE for a kind no family
delivers.
Trait Implementations§
Source§impl Clone for NativeEvent
impl Clone for NativeEvent
impl Copy for NativeEvent
Source§impl Debug for NativeEvent
impl Debug for NativeEvent
impl Eq for NativeEvent
Source§impl PartialEq for NativeEvent
impl PartialEq for NativeEvent
impl StructuralPartialEq for NativeEvent
Auto Trait Implementations§
impl Freeze for NativeEvent
impl RefUnwindSafe for NativeEvent
impl Send for NativeEvent
impl Sync for NativeEvent
impl Unpin for NativeEvent
impl UnsafeUnpin for NativeEvent
impl UnwindSafe for NativeEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key and return true if they are equal.