Enum nze_game_sdl::Error

source ·
pub enum Error {
    Sdl2InitFailure(String),
    Sdl2ChangeState(String),
    LoadFile(String),
    Draw(String),
    TextRender(String),
    MissingResource(String),
    AudioPlay(String),
}
Expand description

Used by the library for reporting errors, so that the calling program can respond appropriately

Variants§

§

Sdl2InitFailure(String)

Some part of sdl failed to initilaize, this error is usually unrecoverable and indicates an issue with the environment or with missing library files

§

Sdl2ChangeState(String)

Error from changing the state of sdl

§

LoadFile(String)

This error indicates a requested resource failed to load, ie a texture or a font from ‘TextureManager::load’ or ‘FontManager::load’

§

Draw(String)

Occurs if there was a problem drawing to the sdl2 ‘Canvas’

§

TextRender(String)

Occurs if there was a problem creating a texture from a font and a string

§

MissingResource(String)

Occurs if a resource that has been freed is used

§

AudioPlay(String)

Occurs if an audio resource fails to play

Trait Implementations§

source§

impl Debug for Error

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.