mobiler-core 0.6.0

Mobiler runtime: the MobilerApp trait + Crux shell adapter over the fixed UI ABI
Documentation

mobiler-core

Mobiler's runtime — the developer-facing API.

Implement MobilerApp with your typed events, model, and a view built from the widget builders. Mobiler wraps it in MobilerShell, a Crux app speaking the fixed UI ABI (mobiler-ui) — so the native shell stays generic and you never touch the wire protocol.

impl MobilerApp for Counter {
    type Event = Msg;
    type Model = Model;

    fn update(&self, msg: Msg, model: &mut Model, cx: &mut Cx<Msg>) {
        match msg {
            Msg::Increment => model.count += 1,
            Msg::Greet => cx.notify("toast", "show", "Hi from Rust!"),
        }
    }

    fn view(&self, model: &Model) -> Widget {
        column(vec![
            title("Counter"),
            text(format!("count: {}", model.count)),
            button("Increment", ButtonStyle::Filled, Msg::Increment),
        ])
    }
}

pub type App = MobilerShell<Counter>;
  • Capabilities via Cx — device APIs as async effects (cx.notify for fire-and-forget, cx.plugin/cx.http/cx.get/… for request-response, cx.save for persistence).
  • Navigation — a core-owned Nav<Route> stack + nav_scaffold.
  • Theme-as-data — dark mode etc. flow through the Widget tree.

Most users go through the mobiler CLI, which scaffolds a project wired to this crate and a generic native shell.

License

Dual-licensed under either MIT or Apache-2.0, at your option.