Skip to main content

CursorShape

Enum CursorShape 

Source
#[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

Source

pub const fn as_css_str(self) -> &'static str

返回标准 CSS cursor 属性名(便于 WebAssembly <canvas> 直接同步浏览器光标)。

Trait Implementations§

Source§

impl Clone for CursorShape

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CursorShape

Source§

impl Debug for CursorShape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CursorShape

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for CursorShape

Source§

impl PartialEq for CursorShape

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CursorShape

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> FluentBuilder for T

Source§

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

根据 condition 在两个修饰分支之间二选一。
Source§

fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self

当 option 为 Some(value) 时执行闭包修饰自身,否则原样返回。
Source§

fn when_none<O>( self, option: &Option<O>, then: impl FnOnce(Self) -> Self, ) -> Self

当 option 为 None 时执行闭包修饰自身,否则原样返回。
Source§

fn apply<U>(self, f: impl FnOnce(Self) -> U) -> U

通用管道映射变换(避免与 Iterator::map / Option::map 重名)。
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,