Expand description
§burin
A retained-mode Rust GUI framework built on the auralis reactive signal kernel.
§Quick start
use burin::core::{Compositor, Widget};
use burin::widgets::display::Text;
use auralis_signal::Signal;
fn hello() -> impl Widget {
Compositor::new(|_scope| {
let _greeting = Signal::new("Hello, world!".to_string());
Text::new("Hello, world!")
})
}§Architecture at a glance
Signal change → dirty flag (O(1) register)
→ process_dirty_set (O(k) ancestor walk)
→ 4-path incremental taffy layout
→ scene/subtree cache check
→ paint only dirty subtrees
→ GPU command submission§Modules
| Module | Content |
|---|---|
core | Widget trait, Element (12 on-demand sub-structs), ElementArena, Compositor, Prop, Context types, signal bridge |
style | Color, Rect, Size, Dimension, Point, Padding, Margin, Styled trait, geometry |
widgets | Built-in widget library (~50 widgets: layout, display, input, overlay, composite, decoration) |
event | Event system (hit testing, gesture, focus, keyboard, action bindings, propagation) |
layout | Layout system (incremental taffy bridge, dirty propagation, grid layout) |
render | Renderer abstraction, Painter API, wgpu GPU backend, tiny-skia CPU backend, text shaping |
platform | Window (winit event loop), accessibility (accesskit), portal system, clipboard, drag-drop, IME |
theme | Theme system, Material 3 design tokens, light/dark auto-detection |
animation | Animation driver, easing curves, property transitions, enter/exit animations |
ecs | Thread-local tracking sets for O(k) operations (theme/drag/scroll/a11y) |
testing | TestHarness — headless full-frame simulation without window/GPU |
debug | Debug utilities |
i18n | Internationalization (Fluent) |
resource | Embedded assets (fonts, icons) |
§Features
backend-wgpu(default) — GPU rendering via wgpu + glyphonbackend-tiny-skia— CPU rasterization via tiny-skia + softbuffer + swashsystem-theme(default) — Auto-detect system light/dark preferenceclipboard(default) — Clipboard access via arboardi18n— Internationalization via Fluentdevtools— Devtools via auralis-devtools + profilinghot-reload— Hot reload via notifyrayon— Parallel processingext-image— Image loading (png, jpeg)ext-jiff— Date/time support- See
Cargo.tomlfor the full list.
§Design principles
- Signal is state. No extra state management abstraction. Reading a
Signalsubscribes; writing notifies. There is no virtual DOM, no diff, no reconciliation. - Composition over macros. No template language, DSL, or proc macros. UI is pure Rust function calls. IDE completions, refactoring, and go-to-definition work without configuration.
- O(k) rendering. Only elements that changed are processed. Dirty flags propagate only up the ancestor chain, short-circuited at containment boundaries. Paint re-records only dirty subtrees; clean subtrees replay from cache.
forbid(unsafe_code)everywhere except platform boundaries.- Retained mode. Each widget mounts into a persistent
Element. Signal changes update in-place; the tree is never rebuilt. - Accessibility is mandatory. AccessKit integration built-in, not bolted on.
Re-exports§
pub use core::error::UiError;
Modules§
- animation
- Animation system: easing curves, spring physics, AnimationDriver, and automatic state-transition animations.
- asset
- Unified asset store: images, SVGs, animations.
- core
- Core abstractions: Widget trait, Element, Context types, Prop, Compositor.
- debug
- Debug diagnostics: frame metrics, element inspector.
- ecs
- Thread-local tracking sets for incremental O(k) operations.
- event
- Event system: event types, hit testing, gesture recognition, focus, keyboard.
- layout
- Layout system: taffy bridge, dirty propagation.
- logging
- physics
- platform
- Platform integration: winit windowing, clipboard, accessibility.
- prelude
- Re-exports for convenient
use burin::prelude::*; - render
- Rendering system: Painter API, draw commands, and backend dispatch.
- resource
- Resource management: fonts, images, icons.
- style
- Styling system: colors, geometry, dimensions, and the
Styledtrait. - task
- testing
- Headless test harness for full-frame simulation without a window or GPU.
- theme
- Theme system: design tokens, semantic colors, state colors, typography, elevation.
- ui
- widgets
- Built-in widget library.
Macros§
- assert_
snapshot - Golden snapshot assertion. Renders the harness’s most recent frame and
compares it against
<CARGO_MANIFEST_DIR>/tests/snapshots/<name>.png. Bless withAURALIS_UPDATE_SNAPSHOTS=1. - t
- vgen