[][src]Crate delorean

DeLorean

A simple single thread reactor pattern implementation. Intended to be used as a singleton and static with single state

Architecture

Cycle

The cycle of App methods is:

  • init:
    • __hydrate(&mut self, _addr: A<Self>)
  • on message:
    • enqueue message
    • is ready? -> update
  • update
    • pop message? -> __dispatch(&mut self, _msg: Self::Message, _addr: A<Self>)
    • is queue empty? -> __render(&mut self, _addr: A<Self>)
    • is queue not empty? -> update

Unsafe code and controversies

Why no RC?

Because it is thinking to be implemented as singleton and static.

Whe no RefCell?

Because all uniques (mutable) references are made in atomic instructions, run! is designed for assure unique owner of all App is Runtime<A>

Macros

run

Macro to create a Runtime<App>

Structs

A

DeLorean for your app. Easy and safe traveling to the future in your thread and the nightly

Addr

The address of App

Context

Encapsulate inner context of the App

DeLorean

DeLorean for your app. Easy and safe traveling to the future in your thread and the nightly

Dispatch

TODO

Hydrate

TODO

Runtime

TODO

Traits

App

App are object which encapsulate state and behavior

Functions

recovery

Recover the owner of app and dealloc Context

Type Definitions

Return