pub struct Handlers<S> { /* private fields */ }Expand description
Implementations§
Source§impl<S> Handlers<S>
impl<S> Handlers<S>
Sourcepub fn dispatch(&mut self, id: ActionId, state: &mut S) -> bool
pub fn dispatch(&mut self, id: ActionId, state: &mut S) -> bool
Invoke the tap handler for id. Returns true if one existed and ran.
Sourcepub fn dispatch_key(
&mut self,
id: FocusId,
input: &KeyInput,
state: &mut S,
) -> bool
pub fn dispatch_key( &mut self, id: FocusId, input: &KeyInput, state: &mut S, ) -> bool
Invoke the key handler for focused element id with input. Returns
true if one existed and ran.
Sourcepub fn dispatch_drag(
&mut self,
id: DragId,
fraction: f64,
state: &mut S,
) -> bool
pub fn dispatch_drag( &mut self, id: DragId, fraction: f64, state: &mut S, ) -> bool
Invoke the drag handler for id with fraction (0..=1 across the
element width). Returns true if one existed and ran.
Sourcepub fn dispatch_text_pos(
&mut self,
id: TextPosId,
index: usize,
extend: bool,
state: &mut S,
) -> bool
pub fn dispatch_text_pos( &mut self, id: TextPosId, index: usize, extend: bool, state: &mut S, ) -> bool
Invoke the text-pointer handler for id with a resolved byte index and
the extend flag. Returns true if one existed and ran.
Sourcepub fn dispatch_context(
&mut self,
id: ContextId,
pos: Point,
state: &mut S,
) -> bool
pub fn dispatch_context( &mut self, id: ContextId, pos: Point, state: &mut S, ) -> bool
Invoke the context (secondary-click) handler for id with the click
pos. Returns true if one existed and ran.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Total number of registered handlers (taps + keys + drags + text-pointer
- context).
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Handlers<S>
impl<S> !Send for Handlers<S>
impl<S> !Sync for Handlers<S>
impl<S> !UnwindSafe for Handlers<S>
impl<S> Freeze for Handlers<S>
impl<S> Unpin for Handlers<S>
impl<S> UnsafeUnpin for Handlers<S>
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