Expand description
§Runtime
The Bubba runtime — bridges Rust UI logic to Android native views, exactly like React Native’s bridge between JS and UIManager.
§Architecture
Rust view! macro → Element tree → JSON
↓
JNI bridge
↓
ViewInflater.java
↓
Real Android Views (TextView, Button…)
↓
User taps button
↓
nativeOnEvent(id, "click", "")
↓
Rust EventDispatcher fires handler
↓
navigate() → new Element tree → JSON
↓
Java re-inflates ViewsStructs§
- Runtime
- The Bubba runtime. One per process.
Constants§
- BUBBA_
VERSION - Bubba runtime version.
Functions§
- alert
- Show a native alert dialog.
- did_
navigate - Returns true if a navigation event occurred since the last render. Called by Java after every nativeOnEvent() to know if it should re-render.
- dispatch_
event - Dispatch an event from Java into the matching Rust EventHandler.
- log_msg
- Log a debug message.
- on_
navigate - Called internally when
navigate()fires so Java knows to re-render. - render_
current_ to_ json - Build the current screen’s element tree, register its handlers, and return the JSON string to send to Java’s ViewInflater.
- set_
global_ runtime - Register the runtime for use by
spawn(). - spawn
- Spawn a future on the async executor.