Skip to main content

Crate mobiler_core

Crate mobiler_core 

Source
Expand description

Mobiler runtime — the developer-facing API.

Implement MobilerApp with your typed events, model, and view (built from the builders). Mobiler wraps it in MobilerShell, a Crux app speaking the fixed UI ABI (mobiler_ui); you never touch the wire protocol. Device APIs are capabilities via Cx.

Structs§

Cx
Effects an app requests during update, generic over the app event type so continuations stay fully typed.
MobilerShell
Crux adapter: turns a MobilerApp into an app speaking the fixed ABI.
Nav
A navigation stack the app holds in its Model. The core owns the stack (single source of truth); the framework reads its route/depth to drive the shell’s push/pop transitions and back button.
PluginCall
PluginNotify
PluginResponse
Rgb
A 24-bit RGB color. Used for a theme’s brand/seed color — the one place an app supplies an arbitrary color (everything else is intent tokens).
Tab
A bottom-navigation tab. selected marks the active one; tapping sends on_select.
Theme
App branding as data — the visual twin of dark_mode. Set on a Widget::Scaffold (theme: None = the framework defaults, i.e. no visual change). The shell maps these to its native theming: seed → the brand/primary color (Android M3 scheme / iOS tint / web --primary), plus a global corner, spacing, and font choice.

Enums§

Action
What the shell sends back to the core. Fixed across all apps.
BoxAlign
ButtonStyle
CardStyle
Corner
Global corner-radius scale. Medium ≈ the current (un-themed) look.
Density
Global spacing scale. Comfortable ≈ the current (un-themed) spacing.
Effect
Built-in capabilities the generic shell fulfils.
EffectFfi
FontFamily
A finite, cross-platform font family (maps to each platform’s nearest system font design — no bundled font files). System ≈ the current look.
Icon
A small, finite icon set (maps to Material icons in the shell).
ImageRatio
ImageShape
InputValue
A value produced by an input widget at runtime.
ProjectColor
Project-identity colors (distinct from semantic Tone). Concrete RGB decided in the render layer.
Spacing
TextStyle
Tone
Semantic status color (distinct from brand/identity color).
Widget
The app-agnostic widget tree the shell renders. Fixed across all apps.

Traits§

MobilerApp
What a Mobiler app implements. Write typed domain events; Mobiler serializes them into opaque tokens behind the scenes.

Functions§

badge
button
caption
card
card_button
A tappable card carrying a typed press event.
checkbox
chip
color_dot
A small colored identity dot.
column
divider
emphasis
grid
icon_button
image
nav_scaffold
Scaffold driven by a Nav stack: fills route (from the current route’s serialization) and depth (stack depth) so the shell animates transitions, and shows a back affordance (top-bar arrow + system back button) firing on_back whenever the stack can pop.
row
scaffold
App shell: top bar + bottom-nav tabs + scrollable body. dark_mode is theme-as-data (the shell themes the whole app from it).
scaffold_back
Like scaffold, but the top bar (and the system back button) navigate back via back — e.g. a detail screen pushed over a tab (treated as depth 2). For multi-level stacks, drive navigation with Nav + nav_scaffold.
slider
spacer
stack
Z-stack/overlay (the Box widget). With scrim, the first child is a darkened background and the rest render on top.
stepper
styled
subtitle
tab
A bottom-nav tab carrying a typed selection event.
text
text_field
title
toggle
with_theme
Apply a Theme to a scaffold (brand color, corner, density, font). No-op on any other widget. Lets an app brand its UI without new scaffold builder overloads: with_theme(nav_scaffold(...), Theme { seed, ..Default::default() }).