Expand description
rcus: a retained, GPU-rendered UI toolkit.
This crate is the front door. It re-exports the core view types, the layout engine, the wgpu renderer, the winit desktop backend, and the QuickJS scripting runtime, so an application depends on one crate and gets the whole stack.
Re-exports§
pub use rcus_core as core;pub use rcus_desktop as desktop;pub use rcus_layout as layout;pub use rcus_render as render;pub use rcus_ts as script;
Modules§
- fonts
- Embedded monospace faces, rasterized into the glyph atlas on first use.
Structs§
- Action
- Animated
- A value moving from
fromtotooverduration, shaped bycurve. - App
- Owns the view tree, its solved layout, and the text atlases.
- Atlas
Set - One atlas layer per distinct (pixel size, monospace) pair, uploaded into a single texture array so a frame still needs only one text bind and one draw.
- Color
- Desktop
App - A window, its event loop, and the app state it renders.
- Entity
- Entity
Id - FocusId
- Focus
State - Frame
- One assembled frame: solid quads, glyph quads, and their clip rectangles.
- Frame
Builder - Turns a layout tree into the two vertex batches the GPU consumes. The builder owns the glyph atlases so a host never touches glyph internals.
- Glyph
Atlas - Dynamic glyph coverage atlas for one face at one pixel size.
- Insets
- Layout
Engine - Layout
Node - A node with its rectangle resolved, in paint order.
- Layout
Tree - One laid-out frame: the resolved tree plus the viewport it was solved for.
- Modifiers
- Motion
Clock - Deadlines by which something still needs a frame.
- Quick
JsRuntime - A QuickJS runtime that records host calls instead of performing them, so the same view module can run headless and in a window.
- Radius
- Corner radii, smallest to largest. A box uses the
mdvalue unless it is told otherwise, so a theme sets three and a view picks one. - Rect
- Renderer
- Draws frames with a solid pass followed by one textured text pass.
- Shadow
- A drop shadow: an offset box, blurred, spread outwards and drawn behind.
- Size
- Style
- Text
Metrics - Font metrics without rasterization, which is what the layout engine needs to size and center text. Advances come straight from the font tables, so this is cheap enough to call per node per frame.
- Viewport
- Viewport size, uploaded once per frame and read by the text shader.
Enums§
- Action
Error - Align
- Axis
- Call
- One request from view code, in the order the runtime received it.
- Curve
- How a value gets from one end to the other.
- Input
Event - Justify
- Key
- Pointer
Button - View
Node - The retained view description a host builds and the layout engine consumes. Script runtimes produce the same tree from JSON, so the renderer never needs to know which frontend authored a frame.
- View
Spec - JSON shape accepted from script runtimes. Kept separate from
ViewNodeso the host owns style defaults and script cannot smuggle in a closure.
Traits§
- Host
- The host side of the bridge. A host implements these once and receives every
call through
deliver. - Lerp
- Values a curve can interpolate. f32 covers geometry, u8 a step, and a colour quadruple a tint.
- Script
Runtime - The engine contract every rcus scripting backend implements.
Functions§
- deliver
- Hands a batch of calls to the host in order, stopping at the first error.