Enum gpui2::DispatchPhase
source · pub enum DispatchPhase {
Bubble,
Capture,
}
Expand description
Represents the two different phases when dispatching events.
Variants§
Bubble
After the capture phase comes the bubble phase, in which mouse event listeners are invoked front to back and keyboard event listeners are invoked from the focused element to the root of the element tree. This is the phase you’ll most commonly want to use when registering event listeners.
Capture
During the initial capture phase, mouse event listeners are invoked back to front, and keyboard listeners are invoked from the root of the tree downward toward the focused element. This phase is used for special purposes such as clearing the “pressed” state for click events. If you stop event propagation during this phase, you need to know what you’re doing. Handlers outside of the immediate region may rely on detecting non-local events during this phase.
Trait Implementations§
source§impl Clone for DispatchPhase
impl Clone for DispatchPhase
source§fn clone(&self) -> DispatchPhase
fn clone(&self) -> DispatchPhase
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DispatchPhase
impl Debug for DispatchPhase
source§impl Default for DispatchPhase
impl Default for DispatchPhase
source§fn default() -> DispatchPhase
fn default() -> DispatchPhase
source§impl PartialEq<DispatchPhase> for DispatchPhase
impl PartialEq<DispatchPhase> for DispatchPhase
source§fn eq(&self, other: &DispatchPhase) -> bool
fn eq(&self, other: &DispatchPhase) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for DispatchPhase
impl Eq for DispatchPhase
impl StructuralEq for DispatchPhase
impl StructuralPartialEq for DispatchPhase
Auto Trait Implementations§
impl RefUnwindSafe for DispatchPhase
impl Send for DispatchPhase
impl Sync for DispatchPhase
impl Unpin for DispatchPhase
impl UnwindSafe for DispatchPhase
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.