Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime<'a, D, C>
where D: DrawTarget<Color = C> + RenderFB + OriginDimensions, C: RgbColor + FromRGB,
{ /* private fields */ }

Implementations§

Source§

impl<'a, D, C> Runtime<'a, D, C>
where D: DrawTarget<Color = C> + RenderFB + OriginDimensions, C: RgbColor + FromRGB,

Source

pub fn new(config: RuntimeConfig<'a, D, C>) -> Result<Self, Error>

Create a new runtime with the wasm module loaded and instantiated.

Source

pub fn set_render_every(&mut self, render_every: u8)

Set how often render should be called relative to update.

Exposed excludively for firefly-test to combat FPS auto-adjustment.

Source

pub fn display_mut(&mut self) -> &mut D

Source

pub fn run(self) -> Result<(), Error>

Run the app until exited or an error occurs.

Source

pub fn start(&mut self) -> Result<(), Error>

Call init functions in the module.

Source

pub fn update(&mut self) -> Result<bool, Error>

Update the app state and flush the frame on the display.

If there is not enough time passed since the last update, the update will be delayed to keep the expected frame rate.

Source

pub fn finalize(self) -> Result<RuntimeConfig<'a, D, C>, Error>

Gracefully stop the runtime.

  1. Calls before_exit callback.
  2. Persists stash and update stats.
  3. Releases Device ownership.
  4. Tells which app to run next.
Source

pub fn device_mut(&mut self) -> &mut DeviceImpl<'a>

Auto Trait Implementations§

§

impl<'a, D, C> !Freeze for Runtime<'a, D, C>

§

impl<'a, D, C> !RefUnwindSafe for Runtime<'a, D, C>

§

impl<'a, D, C> !Send for Runtime<'a, D, C>

§

impl<'a, D, C> !Sync for Runtime<'a, D, C>

§

impl<'a, D, C> Unpin for Runtime<'a, D, C>
where D: Unpin,

§

impl<'a, D, C> UnsafeUnpin for Runtime<'a, D, C>
where D: UnsafeUnpin,

§

impl<'a, D, C> !UnwindSafe for Runtime<'a, D, C>

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

fn to_sample_(self) -> U

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

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

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