Skip to main content

Crate rcus

Crate rcus 

Source
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 from to to over duration, shaped by curve.
App
Owns the view tree, its solved layout, and the text atlases.
AtlasSet
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
DesktopApp
A window, its event loop, and the app state it renders.
Entity
EntityId
FocusId
FocusState
Frame
One assembled frame: solid quads, glyph quads, and their clip rectangles.
FrameBuilder
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.
GlyphAtlas
Dynamic glyph coverage atlas for one face at one pixel size.
Insets
LayoutEngine
LayoutNode
A node with its rectangle resolved, in paint order.
LayoutTree
One laid-out frame: the resolved tree plus the viewport it was solved for.
Modifiers
MotionClock
Deadlines by which something still needs a frame.
QuickJsRuntime
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 md value 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
TextMetrics
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§

ActionError
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.
InputEvent
Justify
Key
PointerButton
ViewNode
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.
ViewSpec
JSON shape accepted from script runtimes. Kept separate from ViewNode so 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.
ScriptRuntime
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.