pub enum Cursor {
Available(Point),
Levitating(Point),
Unavailable,
}
Expand description
The mouse cursor state.
Variants§
Available(Point)
The cursor has a defined position.
Levitating(Point)
The cursor has a defined position, but it’s levitating over a layer above.
The cursor is currently unavailable (i.e. out of bounds or busy).
Implementations§
Source§impl Cursor
impl Cursor
Sourcepub fn position(self) -> Option<Point>
pub fn position(self) -> Option<Point>
Returns the absolute position of the Cursor
, if available.
Sourcepub fn position_over(self, bounds: Rectangle) -> Option<Point>
pub fn position_over(self, bounds: Rectangle) -> Option<Point>
Sourcepub fn position_in(self, bounds: Rectangle) -> Option<Point>
pub fn position_in(self, bounds: Rectangle) -> Option<Point>
Sourcepub fn position_from(self, origin: Point) -> Option<Point>
pub fn position_from(self, origin: Point) -> Option<Point>
Returns the relative position of the Cursor
from the given origin,
if available.
Sourcepub fn is_over(self, bounds: Rectangle) -> bool
pub fn is_over(self, bounds: Rectangle) -> bool
Returns true if the Cursor
is over the given bounds
.
Sourcepub fn is_levitating(self) -> bool
pub fn is_levitating(self) -> bool
Returns true if the Cursor
is levitating over a layer above.
Trait Implementations§
Source§impl Mul<Transformation> for Cursor
impl Mul<Transformation> for Cursor
impl Copy for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.