Enum RetroGame

Source
pub enum RetroGame<'a> {
    None {
        meta: Option<&'a str>,
    },
    Data {
        meta: Option<&'a str>,
        data: &'a [u8],
    },
    Path {
        meta: Option<&'a str>,
        path: &'a str,
    },
}
Expand description

Represents the possible ways that a frontend can pass game information to a core.

Variants§

§

None

Used if a core supports “no game” and no game was selected.

  • meta contains implementation-specific metadata, if present.

Note: “No game” support is hinted with the RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME key.

Fields

§meta: Option<&'a str>
§

Data

Used if a core doesn’t need paths, and a game was selected.

  • meta contains implementation-specific metadata, if present.
  • data contains the entire contents of the game.

Fields

§meta: Option<&'a str>
§data: &'a [u8]
§

Path

Used if a core needs paths, and a game was selected.

  • meta contains implementation-specific metadata, if present.
  • path contains the entire absolute path of the game.

Fields

§meta: Option<&'a str>
§path: &'a str

Trait Implementations§

Source§

impl<'a> From<&retro_game_info> for RetroGame<'a>

Source§

fn from(game: &retro_game_info) -> RetroGame<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for RetroGame<'a>

§

impl<'a> RefUnwindSafe for RetroGame<'a>

§

impl<'a> Send for RetroGame<'a>

§

impl<'a> Sync for RetroGame<'a>

§

impl<'a> Unpin for RetroGame<'a>

§

impl<'a> UnwindSafe for RetroGame<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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