#[repr(u8)]pub enum CursorShape {
Show 13 variants
Default = 0,
Pointer = 1,
Text = 2,
Grab = 3,
Grabbing = 4,
NotAllowed = 5,
Progress = 6,
Move = 7,
Crosshair = 8,
ResizeNS = 9,
ResizeEW = 10,
ResizeNWSE = 11,
ResizeNESW = 12,
}Expand description
鼠标光标视觉形状(对应 wp-cursor-shape-v1、CSS Cursor 与桌面平台标准光标形态)。
Variants§
Default = 0
默认箭头光标。
Pointer = 1
手型点击光标(链接/按钮/复选框/开关/页签悬停)。
Text = 2
I 型文本编辑光标(输入框/代码编辑器)。
Grab = 3
可抓取手型光标(滑块/拖拽把手悬停)。
Grabbing = 4
抓取拖拽中光标(滑块/把手按住拖拽)。
NotAllowed = 5
禁止/禁用不可交互光标(disabled 控件悬停)。
Progress = 6
加载/后台处理进度光标(loading 按钮悬停)。
Move = 7
四向移动光标。
Crosshair = 8
十字准星光标(取色器/画布区域选择)。
ResizeNS = 9
垂直双向调整尺寸光标(上下分隔条/上下边框)。
ResizeEW = 10
水平双向调整尺寸光标(左右分隔条/左右边框)。
ResizeNWSE = 11
对角线调整尺寸光标(左上-右下)。
ResizeNESW = 12
对角线调整尺寸光标(右上-左下)。
Implementations§
Source§impl CursorShape
impl CursorShape
Sourcepub const fn as_css_str(self) -> &'static str
pub const fn as_css_str(self) -> &'static str
返回标准 CSS cursor 属性名(便于 WebAssembly <canvas> 直接同步浏览器光标)。
Trait Implementations§
Source§impl Clone for CursorShape
impl Clone for CursorShape
impl Copy for CursorShape
Source§impl Debug for CursorShape
impl Debug for CursorShape
Source§impl Default for CursorShape
impl Default for CursorShape
impl Eq for CursorShape
Source§impl PartialEq for CursorShape
impl PartialEq for CursorShape
impl StructuralPartialEq for CursorShape
Auto Trait Implementations§
impl Forget for CursorShape
impl Freeze for CursorShape
impl Move for CursorShape
impl RefUnwindSafe for CursorShape
impl Send for CursorShape
impl Sync for CursorShape
impl Unpin for CursorShape
impl UnsafeUnpin for CursorShape
impl UnwindSafe for CursorShape
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。