#[non_exhaustive]pub enum CursorIcon {
Default,
Pointer,
Text,
Grab,
Grabbing,
ColResize,
RowResize,
NotAllowed,
}Expand description
The pointer cursor a widget asks the host to display.
A request vocabulary, not a rendering one: platform-neutral names a
widget states its intent in (EventCtx::set_cursor), which a desktop shell
maps onto its own host API — frust-shell-desktop onto winit’s own cursor
icons, the one place any of these names touches a platform. Deliberately
tiny: the shapes a desktop-class design system actually needs, not a full CSS
cursor set.
#[non_exhaustive] from birth, so widening it later cannot break an
out-of-tree match (a shell or design system must carry a wildcard arm and
degrade an unknown request to CursorIcon::Default rather than fail to
compile).
Nothing below a desktop shell honours a request. The mobile shells never read the resolved value — a touch host has no pointer to shape — so a widget may set a cursor unconditionally and get the desktop behaviour where it exists and no behaviour at all where it does not.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default
The host’s ordinary arrow. The resolved value of any pass in which no
widget asked for anything else, so a widget never has to ask for it to
“give the cursor back” (see EventCtx::set_cursor).
Pointer
The clickable hand: buttons, links, and anything else a press activates.
Text
The text I-beam: editable or selectable text.
Grab
An open hand: this is draggable, and no drag has started yet.
Grabbing
A closed hand: a drag is in progress.
ColResize
A column-resize handle — a divider the pointer moves horizontally.
RowResize
A row-resize handle — a divider the pointer moves vertically.
NotAllowed
The action under the pointer is refused: a disabled control, or a drop target rejecting what is being dragged.
Trait Implementations§
Source§impl Clone for CursorIcon
impl Clone for CursorIcon
impl Copy for CursorIcon
Source§impl Debug for CursorIcon
impl Debug for CursorIcon
Source§impl Default for CursorIcon
impl Default for CursorIcon
impl Eq for CursorIcon
Source§impl Hash for CursorIcon
impl Hash for CursorIcon
Source§impl PartialEq for CursorIcon
impl PartialEq for CursorIcon
impl StructuralPartialEq for CursorIcon
Auto Trait Implementations§
impl Freeze for CursorIcon
impl RefUnwindSafe for CursorIcon
impl Send for CursorIcon
impl Sync for CursorIcon
impl Unpin for CursorIcon
impl UnsafeUnpin for CursorIcon
impl UnwindSafe for CursorIcon
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
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
key and return true if they are equal.