pub struct EventPropagation {
pub stopped: bool,
pub default_prevented: bool,
pub phase: PropagationPhase,
pub target_id: Option<usize>,
pub current_target_id: Option<usize>,
}
Expand description
Controls how an event propagates through the component tree
Fields§
§stopped: bool
Whether the event should continue propagating
default_prevented: bool
Whether the default action should be prevented
phase: PropagationPhase
The current propagation phase
target_id: Option<usize>
The component that is the original target of the event
current_target_id: Option<usize>
The component that is currently handling the event
Implementations§
Source§impl EventPropagation
impl EventPropagation
Sourcepub fn new(phase: PropagationPhase) -> Self
pub fn new(phase: PropagationPhase) -> Self
Create a new event propagation
Sourcepub fn stop_propagation(&mut self)
pub fn stop_propagation(&mut self)
Stop event propagation
Sourcepub fn prevent_default(&mut self)
pub fn prevent_default(&mut self)
Prevent the default action
Sourcepub fn is_propagation_stopped(&self) -> bool
pub fn is_propagation_stopped(&self) -> bool
Check if propagation is stopped
Sourcepub fn is_default_prevented(&self) -> bool
pub fn is_default_prevented(&self) -> bool
Check if default is prevented
Trait Implementations§
Source§impl Clone for EventPropagation
impl Clone for EventPropagation
Source§fn clone(&self) -> EventPropagation
fn clone(&self) -> EventPropagation
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for EventPropagation
impl RefUnwindSafe for EventPropagation
impl Send for EventPropagation
impl Sync for EventPropagation
impl Unpin for EventPropagation
impl UnwindSafe for EventPropagation
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> Event for T
impl<T> Event for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to Any for downcasting (mutable)
Source§fn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type name
Source§impl<T> Props for T
impl<T> Props for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any for downcasting