Skip to main content

Driver

Struct Driver 

Source
pub struct Driver<G: GameData, S: Sdk> { /* private fields */ }
Expand description

A game on the Playdate: its App and the backend.

Implementations§

Source§

impl<G: GameData, S: Sdk> Driver<G, S>

Source

pub fn new(start: Start<G>, sdk: S) -> Self

The game start says on sdk.

Source

pub fn with_report(start: Start<G>, sdk: S, report: RunReport) -> Self

The game start says on sdk, saying in the console how its start went and how fast it runs, as report says (report).

Source

pub fn update(&mut self) -> bool

One update of the SDK’s: true when the screen changed.

Source

pub fn event(&mut self, event: SdkEvent)

The SDK’s event. What must be heard before the system stops the updates runs a frame now: App lets the game save and steps nothing.

Source

pub fn menu_chosen(&mut self, slot: u8)

The player chose the system menu’s item in slot.

Source

pub fn app(&self) -> &App<G>

The game’s app, for the tests.

Source

pub fn platform(&self) -> &Playdate<S>

The backend, for the tests.

Auto Trait Implementations§

§

impl<G, S> !Freeze for Driver<G, S>

§

impl<G, S> !RefUnwindSafe for Driver<G, S>

§

impl<G, S> !Send for Driver<G, S>

§

impl<G, S> !Sync for Driver<G, S>

§

impl<G, S> !UnwindSafe for Driver<G, S>

§

impl<G, S> Unpin for Driver<G, S>
where S: Unpin, <G as GameData>::Voice: Unpin, <S as Sdk>::Sample: Unpin, <S as Sdk>::SamplePlayer: Unpin, <S as Sdk>::FilePlayer: Unpin,

§

impl<G, S> UnsafeUnpin for Driver<G, S>

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.