Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime<A: App> { /* private fields */ }
Expand description

Drives an App with the protocol. Construct with Runtime::new.

Implementations§

Source§

impl<A: App> Runtime<A>

Source

pub fn new(boot: &[u8]) -> Self

Boot facts from the shell (JSON). Bad JSON boots with null. Boot effects stay queued until the next response.

Trait Implementations§

Source§

impl<A: App> Bridge for Runtime<A>

Source§

fn dispatch(&mut self, input: &[u8]) -> Vec<u8> ⓘ

One protocol line in, one response out.
Source§

fn pointer(&mut self, phase: u8, x: f32, y: f32, at_ms: f64) -> u32

Typed fast path, no JSON. Returns a bitmask: bit 0 = dirty views queued, bit 1 = effects pending.
Source§

fn view(&self, key: &str) -> Vec<u8> ⓘ

The JSON of one view key (null when unknown).
Source§

fn provide_blob(&mut self, name: &str, bytes: &[u8]) -> Vec<u8> ⓘ

Large binary input off the JSON path, named by the app.

Auto Trait Implementations§

§

impl<A> Forget for Runtime<A>

§

impl<A> Freeze for Runtime<A>
where A: Freeze, Ctx<<A as App>::Effect>: Freeze,

§

impl<A> Move for Runtime<A>

§

impl<A> RefUnwindSafe for Runtime<A>

§

impl<A> Send for Runtime<A>
where A: Send, Ctx<<A as App>::Effect>: Send,

§

impl<A> Sync for Runtime<A>
where A: Sync, Ctx<<A as App>::Effect>: Sync,

§

impl<A> Unpin for Runtime<A>
where A: Unpin, Ctx<<A as App>::Effect>: Unpin,

§

impl<A> UnsafeUnpin for Runtime<A>
where A: UnsafeUnpin, Ctx<<A as App>::Effect>: UnsafeUnpin,

§

impl<A> UnwindSafe for Runtime<A>
where A: UnwindSafe, Ctx<<A as App>::Effect>: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.