Enum ggez::error::GameError

source ·
pub enum GameError {
Show 22 variants GraphicsInitializationError, FilesystemError(String), ConfigError(String), EventLoopError(String), ResourceLoadError(String), ResourceNotFound(String, Vec<(PathBuf, GameError)>), RenderError(String), RequestDeviceError(RequestDeviceError), AudioError(String), WindowError(String), WindowCreationError(Arc<OsError>), IOError(Arc<Error>), FontError(InvalidFont), ShaderEncodingError(FromUtf8Error), VideoError(String), GamepadError(String), LyonError(String), GlyphBrushError(BrushError), FontSelectError(String), BufferAsyncError(BufferAsyncError), LockError, CustomError(String),
}
Expand description

An enum containing all kinds of game framework errors.

Variants§

§

GraphicsInitializationError

An error when intializing the graphics system.

§

FilesystemError(String)

An error in the filesystem layout

§

ConfigError(String)

An error in the config file

§

EventLoopError(String)

Happens when an winit::event_loop::EventLoopProxy attempts to wake up an winit::event_loop::EventLoop that no longer exists.

§

ResourceLoadError(String)

An error trying to load a resource, such as getting an invalid image file.

§

ResourceNotFound(String, Vec<(PathBuf, GameError)>)

Unable to find a resource; the Vec is the paths it searched for and associated errors

§

RenderError(String)

Something went wrong in the renderer

§

RequestDeviceError(RequestDeviceError)

Something went wrong when requesting a logical device from the graphics API.

§

AudioError(String)

Something went wrong in the audio playback

§

WindowError(String)

Something went wrong trying to set or get window properties.

§

WindowCreationError(Arc<OsError>)

Something went wrong trying to create a window

§

IOError(Arc<Error>)

Something went wrong trying to read from a file

§

FontError(InvalidFont)

Something went wrong trying to load a font

§

ShaderEncodingError(FromUtf8Error)

Shader encoding error (not valid utf-8)

§

VideoError(String)

Something went wrong applying video settings.

§

GamepadError(String)

Something went wrong with the gilrs gamepad-input library.

§

LyonError(String)

Something went wrong with the lyon shape-tesselation library.

§

GlyphBrushError(BrushError)

Something went wrong when drawing text.

§

FontSelectError(String)

Attempted to draw text with a non-existent font name.

§

BufferAsyncError(BufferAsyncError)

Something went wrong when asynchronously mapping a GPU buffer.

§

LockError

Deadlock when trying to lock a mutex.

§

CustomError(String)

A custom error type for use by users of ggez. This lets you handle custom errors that may happen during your game (such as, trying to load a malformed file for a level) using the same mechanism you handle ggez’s other errors.

Please include an informative message with the error.

Trait Implementations§

source§

impl Debug for GameError

source§

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

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

impl Display for GameError

source§

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

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

impl Error for GameError

source§

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

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
1.30.0 · source§

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

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()
source§

fn provide<'a>(&'a self, demand: &mut Demand<'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 From<Arc<Error>> for GameError

source§

fn from(s: Arc<Error>) -> GameError

Converts to this type from the input type.
source§

impl From<Arc<OsError>> for GameError

source§

fn from(s: Arc<OsError>) -> GameError

Converts to this type from the input type.
source§

impl From<BrushError> for GameError

source§

fn from(s: BrushError) -> GameError

Converts to this type from the input type.
source§

impl From<BufferAsyncError> for GameError

source§

fn from(s: BufferAsyncError) -> GameError

Converts to this type from the input type.
source§

impl From<DecoderError> for GameError

source§

fn from(e: DecoderError) -> GameError

Converts to this type from the input type.
source§

impl From<Error> for GameError

source§

fn from(e: Error) -> GameError

Converts to this type from the input type.
source§

impl From<Error> for GameError

source§

fn from(e: Error) -> GameError

Converts to this type from the input type.
source§

impl From<Error> for GameError

source§

fn from(e: Error) -> GameError

Converts to this type from the input type.
source§

impl From<Error> for GameError

source§

fn from(s: Error) -> GameError

Converts to this type from the input type.
source§

impl From<GeometryBuilderError> for GameError

source§

fn from(s: GeometryBuilderError) -> GameError

Converts to this type from the input type.
source§

impl From<ImageError> for GameError

source§

fn from(e: ImageError) -> GameError

Converts to this type from the input type.
source§

impl From<InvalidFont> for GameError

source§

fn from(s: InvalidFont) -> GameError

Converts to this type from the input type.
source§

impl From<OsError> for GameError

source§

fn from(s: OsError) -> GameError

Converts to this type from the input type.
source§

impl From<PlayError> for GameError

source§

fn from(e: PlayError) -> GameError

Converts to this type from the input type.
source§

impl From<RequestDeviceError> for GameError

source§

fn from(s: RequestDeviceError) -> GameError

Converts to this type from the input type.
source§

impl From<TessellationError> for GameError

source§

fn from(s: TessellationError) -> GameError

Converts to this type from the input type.
source§

impl From<ZipError> for GameError

source§

fn from(e: ZipError) -> GameError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T> Has<T> for T

source§

fn retrieve(&self) -> &T

Method to retrieve the context type.
source§

impl<T> HasMut<T> for T

source§

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

Method to retrieve the context type as mutable.
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,