# Cursor

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/struct-cursor/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct Cursor
```

Represents a mouse cursor.

Cursors have reference semantics: two cursors are equal only if they are
the same object.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/cursor.rs#L129)

## Members

- [`default_cursor`](#function-default_cursor)
- [`new`](#function-new)
- [`from_bitmap`](#function-from_bitmap)
- [`dispose`](#function-dispose)
- [`parse`](#function-parse)

<a id="function-default_cursor"></a>

### default_cursor

```rust
fn default_cursor() -> Rc<Cursor>
```

The default cursor: the standard arrow.

Panics if no cursor factory is registered with the locator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/cursor.rs#L142)

<a id="function-new"></a>

### new

```rust
fn new(cursor_type: StandardCursorType) -> Rc<Cursor>
```

Creates a standard cursor.

Panics if no cursor factory is registered with the locator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/cursor.rs#L154)

<a id="function-from_bitmap"></a>

### from_bitmap

```rust
fn from_bitmap(cursor: &Bitmap, hot_spot: PixelPoint) -> Rc<Cursor>
```

Creates a cursor from a bitmap. `hot_spot` is the position within
the bitmap that is the position of the pointer.

Panics if no cursor factory is registered with the locator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/cursor.rs#L165)

<a id="function-dispose"></a>

### dispose

```rust
fn dispose(self: &Self)
```

Releases the platform resources of the cursor.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/cursor.rs#L178)

<a id="function-parse"></a>

### parse

```rust
fn parse(s: &str) -> Result<Rc<Cursor>, ParseCursorError>
```

Creates a standard cursor from the name of its type.

Panics if no cursor factory is registered with the locator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/cursor.rs#L185)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `PartialEq`
- `Eq`
- `Display`
- `Debug`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
