[][src]Struct sauron::Program

pub struct Program<APP, MSG> where
    MSG: 'static, 
{ pub app: Rc<RefCell<APP>>, pub dom_updater: Rc<RefCell<DomUpdater<MSG>>>, }

Holds the user App and the dom updater This is passed into the event listener and the dispatch program will be called after the event is triggered.

Fields

app: Rc<RefCell<APP>>

holds the user application

dom_updater: Rc<RefCell<DomUpdater<MSG>>>

The dom_updater responsible to updating the actual document in the browser

Implementations

impl<APP, MSG> Program<APP, MSG> where
    APP: Component<MSG> + 'static,
    MSG: 'static, 
[src]

pub fn new_replace_mount(app: APP, root_node: &Node) -> Program<APP, MSG>[src]

Creates an Rc wrapped instance of Program and replace the root_node with the app view

pub fn new_append_to_mount(app: APP, root_node: &Node) -> Program<APP, MSG>[src]

Instantiage an app and append the view to the root_node

pub fn mount_to_body(app: APP) -> Program<APP, MSG>[src]

Instantiate the app and then append it to the document body

Trait Implementations

impl<APP, MSG> Clone for Program<APP, MSG> where
    MSG: 'static, 
[src]

impl<APP, MSG> Dispatch<MSG> for Program<APP, MSG> where
    APP: Component<MSG> + 'static,
    MSG: 'static, 
[src]

This will be called when the actual event is triggered. Defined in the DomUpdater::create_closure_wrap function

Auto Trait Implementations

impl<APP, MSG> !RefUnwindSafe for Program<APP, MSG>

impl<APP, MSG> !Send for Program<APP, MSG>

impl<APP, MSG> !Sync for Program<APP, MSG>

impl<APP, MSG> Unpin for Program<APP, MSG>

impl<APP, MSG> !UnwindSafe for Program<APP, MSG>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.