Skip to main content

Crate burin

Crate burin 

Source
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

ModuleContent
coreWidget trait, Element (12 on-demand sub-structs), ElementArena, Compositor, Prop, Context types, signal bridge
styleColor, Rect, Size, Dimension, Point, Padding, Margin, Styled trait, geometry
widgetsBuilt-in widget library (~50 widgets: layout, display, input, overlay, composite, decoration)
eventEvent system (hit testing, gesture, focus, keyboard, action bindings, propagation)
layoutLayout system (incremental taffy bridge, dirty propagation, grid layout)
renderRenderer abstraction, Painter API, wgpu GPU backend, tiny-skia CPU backend, text shaping
platformWindow (winit event loop), accessibility (accesskit), portal system, clipboard, drag-drop, IME
themeTheme system, Material 3 design tokens, light/dark auto-detection
animationAnimation driver, easing curves, property transitions, enter/exit animations
ecsThread-local tracking sets for O(k) operations (theme/drag/scroll/a11y)
testingTestHarness — headless full-frame simulation without window/GPU
debugDebug utilities
i18nInternationalization (Fluent)
resourceEmbedded assets (fonts, icons)

§Features

  • backend-wgpu (default) — GPU rendering via wgpu + glyphon
  • backend-tiny-skia — CPU rasterization via tiny-skia + softbuffer + swash
  • system-theme (default) — Auto-detect system light/dark preference
  • clipboard (default) — Clipboard access via arboard
  • i18n — Internationalization via Fluent
  • devtools — Devtools via auralis-devtools + profiling
  • hot-reload — Hot reload via notify
  • rayon — Parallel processing
  • ext-image — Image loading (png, jpeg)
  • ext-jiff — Date/time support
  • See Cargo.toml for the full list.

§Design principles

  1. Signal is state. No extra state management abstraction. Reading a Signal subscribes; writing notifies. There is no virtual DOM, no diff, no reconciliation.
  2. 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.
  3. 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.
  4. forbid(unsafe_code) everywhere except platform boundaries.
  5. Retained mode. Each widget mounts into a persistent Element. Signal changes update in-place; the tree is never rebuilt.
  6. 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 Styled trait.
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 with AURALIS_UPDATE_SNAPSHOTS=1.
t
vgen