[][src]Struct seed::AppBuilder

pub struct AppBuilder<Ms: 'static, Mdl: 'static, ElC: View<Ms>, GMs> { /* fields omitted */ }

Used to create and store initial app configuration, ie items passed by the app creator

Methods

impl<Ms, Mdl, ElC: View<Ms> + 'static, GMs: 'static> Builder<Ms, Mdl, ElC, GMs>[src]

pub fn mount(self, mount_point: impl MountPoint) -> Self[src]

Choose the element where the application will be mounted. The default one is the element with id = "app".

Examples

// argument is `&str`
mount("another_id")

// argument is `HTMLElement`
// NOTE: Be careful with mounting into body,
// it can cause hard-to-debug bugs when there are other scripts in the body.
mount(seed::body())

// argument is `Element`
mount(seed::body().querySelector("section").unwrap().unwrap())

pub fn routes(self, routes: fn(_: Url) -> Option<Ms>) -> Self[src]

Registers a function which maps URLs to messages.

pub fn window_events(self, evts: fn(_: &Mdl) -> Vec<Listener<Ms>>) -> Self[src]

Registers a function which decides how window events will be handled.

pub fn sink(
    self,
    sink: fn(_: GMs, _: &mut Mdl, _: &mut OrdersContainer<Ms, Mdl, ElC, GMs>)
) -> Self
[src]

Registers a sink function.

The sink function is a function which can update the model based on global messages. Consider to use a sink function when a submodule needs to trigger changes in other modules.

pub fn finish(self) -> App<Ms, Mdl, ElC, GMs>[src]

Deprecated since 0.4.2:

Please use .build_and_start instead

Turn this Builder into an App which is ready to run.

pub fn build_and_start(self) -> App<Ms, Mdl, ElC, GMs>[src]

Build and run the app.

Auto Trait Implementations

impl<Ms, Mdl, ElC, GMs> !Send for Builder<Ms, Mdl, ElC, GMs>

impl<Ms, Mdl, ElC, GMs> !Sync for Builder<Ms, Mdl, ElC, GMs>

impl<Ms, Mdl, ElC, GMs> Unpin for Builder<Ms, Mdl, ElC, GMs>

impl<Ms, Mdl, ElC, GMs> !UnwindSafe for Builder<Ms, Mdl, ElC, GMs>

impl<Ms, Mdl, ElC, GMs> !RefUnwindSafe for Builder<Ms, Mdl, ElC, GMs>

Blanket Implementations

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

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

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.

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

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

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