pub struct HitboxId(/* private fields */);Expand description
An identifier for a Hitbox which also includes HitboxBehavior.
Implementations§
Source§impl HitboxId
impl HitboxId
Sourcepub fn is_hovered(self, window: &Window) -> bool
pub fn is_hovered(self, window: &Window) -> bool
Checks if the hitbox with this ID is currently hovered. Returns false during keyboard
input modality so that keyboard navigation suppresses hover highlights. Except when handling
ScrollWheelEvent, this is typically what you want when determining whether to handle mouse
events or paint hover styles.
See Hitbox::is_hovered for details.
Sourcepub fn should_handle_scroll(self, window: &Window) -> bool
pub fn should_handle_scroll(self, window: &Window) -> bool
Checks if the hitbox with this ID contains the mouse and should handle scroll events.
Typically this should only be used when handling ScrollWheelEvent, and otherwise
is_hovered should be used. See the documentation of Hitbox::is_hovered for details about
this distinction.
Trait Implementations§
impl Copy for HitboxId
impl Eq for HitboxId
impl StructuralPartialEq for HitboxId
Auto Trait Implementations§
impl Freeze for HitboxId
impl RefUnwindSafe for HitboxId
impl Send for HitboxId
impl Sync for HitboxId
impl Unpin for HitboxId
impl UnsafeUnpin for HitboxId
impl UnwindSafe for HitboxId
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<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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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