Skip to main content

PlatformError

Enum PlatformError 

Source
#[non_exhaustive]
pub enum PlatformError {
Show 15 variants Unsupported, NoDisplay { wayland: bool, }, LibraryNotFound { library: &'static str, reason: String, }, MissingSymbols { library: &'static str, symbols: Vec<&'static str>, }, ConnectionFailed { display: String, }, CallFailed { call: &'static str, }, InvalidName { name: String, }, NoHomeDirectory, NotMainThread, GpuCallFailed { call: &'static str, error: String, }, NoGlConfig, GlTooOld { found: Option<String>, }, GlContextExists, InvalidAudioConfig { field: &'static str, expected: &'static str, }, AudioCallFailed { call: &'static str, error: String, },
}
Expand description

Errors produced by nadir-platform.

New kinds of error can join it in a minor version (ADR-0047), so a match on it needs a _ arm.

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.
§

Unsupported

This operating system has no backend yet.

§

NoDisplay

There is no display server to connect to.

Fields

§wayland: bool

Whether a Wayland session is running. If so, it runs without XWayland.

§

LibraryNotFound

A system library could not be loaded.

Fields

§library: &'static str

The file name of the library, such as libX11.so.6.

§reason: String

What the system’s loader said.

§

MissingSymbols

A system library lacks functions that the engine calls.

Fields

§library: &'static str

The file name of the library.

§symbols: Vec<&'static str>

The name of every missing function.

§

ConnectionFailed

The display server did not accept the connection.

Fields

§display: String

The display that was tried, as DISPLAY names it.

§

CallFailed

A call to the operating system failed.

Fields

§call: &'static str

The function that failed.

§

InvalidName

A studio or game name cannot be a folder name on every system. See user_dirs.

Fields

§name: String

The name as given.

§

NoHomeDirectory

The user’s home directory is unknown, and the folders for settings and data are inside it.

§

NotMainThread

The window was to be opened on a thread other than the main one, which macOS does not allow.

§

GpuCallFailed

A call to EGL or OpenGL failed.

Fields

§call: &'static str

The function that failed.

§error: String

What went wrong: the error that the call reported, such as EGL_BAD_MATCH, or what was wrong with what it returned.

§

NoGlConfig

The graphics driver has no OpenGL frame buffer format with 8 bits each of red, green and blue that suits the window, or offscreen drawing.

§

GlTooOld

The graphics driver does not offer OpenGL 3.3 with the core profile.

Fields

§found: Option<String>

The version that the driver did give, as its GL_VERSION string, if a context could be made at all.

§

GlContextExists

This thread already has an OpenGL context: the window’s, or one from create_headless_gl. A thread can have one at a time.

§

InvalidAudioConfig

A field of an AudioOutputConfig is out of its range.

Fields

§field: &'static str

The field, such as channels.

§expected: &'static str

Its range, such as 1 to 8.

§

AudioCallFailed

A call to set up the audio output failed. See open_audio.

Fields

§call: &'static str

The function that failed, such as snd_pcm_set_params.

§error: String

What went wrong, as the system said it, and which device.

Trait Implementations§

Source§

impl Clone for PlatformError

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 PlatformError

Source§

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

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

impl Display for PlatformError

Source§

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

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

impl Eq for PlatformError

Source§

impl Error for PlatformError

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 PlatformError

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 PlatformError

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.