Skip to main content

CursorError

Enum CursorError 

Source
#[non_exhaustive]
pub enum CursorError { InvalidName, NoThemes, NotFound, Malformed, TooLarge, NoImages, InvalidImage, Io(String), NoPlane, Unsupported, MissingProperty, PlaneUnusable, }
Expand description

What can go wrong finding a cursor.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidName

The cursor name is empty, ., .., or contains a path separator.

A cursor name is an identifier, not a path. Refusing the ambiguous cases keeps a caller-supplied name from composing into somewhere else on the filesystem.

§

NoThemes

No cursor theme directory was readable at all.

Distinct from CursorError::NotFound: this one means nothing is installed, which is a different thing to say to a user.

§

NotFound

No theme on the search path has this cursor.

§

Malformed

The file is not a cursor, is truncated, or contradicts itself.

§

TooLarge

The file declares more frames, or larger frames, than are accepted.

Separate from CursorError::Malformed because such a file may be perfectly well-formed – it is refused for being unreasonable, not for being broken, and that is worth saying differently.

§

NoImages

The file parsed but holds no images.

§

InvalidImage

Caller-supplied pixels do not describe an image.

§

Io(String)

A file read or an ioctl failed: the cursor file, a buffer allocation, a property read, or a commit. Carries the underlying error’s text.

§

NoPlane

No plane on this CRTC can carry a cursor, and legacy was not allowed.

§

Unsupported

The only available path cannot carry this cursor.

Today that means legacy drmModeSetCursor, on a controller with no cursor hardware at all, or with a rotation the legacy call cannot express. A caller told this can composite a cursor instead, which beats a renderer that fails on its first show.

§

MissingProperty

The plane is missing a property every plane is required to have.

A broken driver rather than anything a caller did.

§

PlaneUnusable

A caller-named plane does not exist, cannot feed this CRTC, or can take none of CURSOR_FORMATS.

Distinct from CursorError::NoPlane: the caller overrode the policy and the override does not work. Falling back silently would leave them on a plane they did not ask for.

Trait Implementations§

Source§

impl Clone for CursorError

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 Debug for CursorError

Source§

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

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

impl Display for CursorError

Source§

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

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

impl Eq for CursorError

Source§

impl Error for CursorError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for CursorError

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 CursorError

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<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<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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.