Skip to main content

Crate telar

Crate telar 

Source

Re-exports§

pub use config::RendererBackend;
pub use app::App;
pub use app_config::AppConfig;
pub use app_context::AppCtx;
pub use app_context::RedrawWaker;
pub use dev_plugin::DevAction;
pub use dev_plugin::DevPlugin;
pub use prefs::UserPrefs;
pub use tree::Frame;
pub use tree::HotTree;
pub use tree::LocalTree;
pub use tree::UiTree;
pub use surface::SurfaceContent;
pub use surface::SurfaceControl;
pub use surface::SurfaceHost;
pub use surface::SurfaceToken;
pub use surface::open_surface;
pub use surface::set_surface_host;
pub use surface::surface_content;
pub use runner::build_surface_handler;
pub use runner::run_multi_with_platform;
pub use runner::run_with_platform;
pub use runner::set_default_font_family;
pub use runner::SurfaceWindow;
pub use runner::run_with_platform_and_renderer;
pub use runner::open_window;
pub use runner::run_app_windowed;
pub use runner::run_app_with_name;
pub use motion_core as motion;
pub use i18n_core as i18n;

Modules§

app
app_config
app_context
clipboard
The system clipboard, as the vocabulary crate sees it.
config
dev_plugin
The seam the in-app devtools overlay plugs into, and the tree model it reads.
files
Native file dialogs.
focus
Keyboard focus: which widget receives key events. A base primitive with no styling of its own — a focusable widget (e.g. crate::Input) requests focus on tap and consults it in on_event/view.
gpu
The GPU objects every surface in the process shares, lent to an application that wants to draw its own content into Telar’s frame.
paths
Where an application’s files go, asked rather than re-derived.
prefs
runner
surface
Backend-agnostic secondary-surface runtime: routes open_surface requests to an installed host.
tree
The mounted UI as the runner sees it — and the seam that lets the app’s own runtime own it.
window
Window-management calls for UI code. A custom title bar’s buttons call these directly — including from .rsx on_press handlers (on_press(|| telar::window::close())). Each enqueues a platform_core::WindowCommand that the runner applies to the OS window right after the current event is dispatched. On backends without a movable top-level window (layer-shell, headless) they are inert no-ops.

Macros§

app
children
rsx_modules
Transpile every .rsx file under src/ and declare the module tree — what app! does, minus the winit runner. Use this in a crate that drives rsx through a custom Platform (e.g. a Wayland layer-shell backend) instead of the built-in desktop runner: invoke telar::rsx_modules!() at the crate root, then build your own App from the transpiled components and run it via telar::run_with_platform / telar::run_multi_with_platform. Pass a theme type — rsx_modules!(MyTheme) — if your .rsx calls use_theme; otherwise rsx_modules!().
static_rc_str
Caches an Arc<str> per call site in thread-local storage so a string literal allocates at most once per thread instead of once per frame.
t
Translates a catalog key to a String, substituting named arguments: t!("battery.remaining", time = t).

Structs§

AlignItems
Used to control how child nodes are aligned. For Flexbox it controls alignment in the cross axis. For Grid it controls alignment in the block axis.
BorderRadius
CacheStat
What the CPU renderer’s caches are holding, and a way to make them let go. Exposed so an app can answer “is the memory in the renderer?” from outside the renderer, which nothing short of a heap profiler could do before. What one cache is holding, for a census something outside the renderer can read.
Canvas
Children
A component’s markup children, not yet built.
ClippedItem
Wraps a child so its rendered output is clipped to the child’s own layout rect. When the child collapses to a zero rect (e.g. a section hidden via display:none), the clip is empty, so nothing inside draws — even a widget left with a stale rect or one that paints at fixed coordinates. Layout is unchanged: layout_node passes through to the wrapped child.
Color
ComponentList
Container
DesktopPathsProvider
DragStart
What armed a drag: the button pressed, and what was held down at that moment.
DrawState
Flat draw state tracking clips and transforms. Note: PushLayer and PopLayer commands are intentionally not tracked here; layers are managed outside this struct by the caller.
Effect
A live subscription. Dropping it deregisters the effect, so the closure runs once and never again — which looks exactly like a working binding until the value it derives is expected to move. Bind it to something that lives as long as the work should: a struct field, a returned value, or a let the reader captures.
Emitter
The worker’s handle to a spawn_stream, for posting items back to the UI thread. Send and cloneable, so the work can hand it to nested helpers or a callback-driven library.
FontConfig
Shared font configuration for both software and hardware renderers. Lets callers supply extra fonts, raw font bytes, a system fonts directory, and preferred sans-serif families without duplicating these fields across renderer-specific config structs.
Gradient
GradientStop
GradientStops
Up to 8 gradient color stops. Fixed-size array preserves the Copy bound.
Holding
Wraps a widget so that dropping the widget drops a set of Effects with it.
Image
ImageData
Input
A single-line editable text field bound to a RwSignal<String>. A base primitive: unstyled (no border or background — wrap it in a box for the look) and keyboard-driven. It requests focus on tap and, while focused, edits the bound signal from key events, drawing a caret at the insertion point. Selection (Shift+arrows/Home/End, Ctrl+A) with copy, cut and paste; IME composition is not yet supported. Drag-to-select waits on click-to-position, which this field does not have either.
KeyNav
How a list reads keys: the arrows always, and optionally the vim bindings on top.
LayoutScrollArea
LayoutStyle
Lazy
A subtree that is not built until the first time it would be shown — lazy when:$cond { … } in .rsx.
Line
Line is designed for use inside Canvas closures where you control absolute coordinates. It does not implement LayoutItem because its p1/p2 points are absolute, not relative to a layout rect. To use Line in a layout context, embed it in a Canvas widget.
LineGutter
A line-number gutter for a code editor: the column “1\n2\n3…” drawn top-aligned with the same line height a TextArea uses, so line n here sits exactly on line n of the editor. Place it beside the editor inside the same scroll (so they scroll together) and give both the same font_size. It measures its own width from the widest number and its height from the line count, re-measuring reactively as the count changes. Toggle it by collapsing its node (set_display) inside a ClippedItem so a hidden gutter both takes no width and draws nothing.
Margin
A box’s four margins, named by axis so they follow the writing direction rather than the screen.
Memo
ModifiersState
NoPaths
A provider that reports no directories at all, so nothing it is handed to touches a real XDG path.
NodeVec
Overlay
A portal layer: its content is laid out out-of-flow, filling the viewport, and hoisted to the top at compose time — drawn above everything and free of any ancestor clip/transform. A base primitive: unstyled; wrap content in a box for a scrim/panel, and position it with normal flex (align/justify).
Path
Path is designed for use inside Canvas closures where you control absolute coordinates. It does not implement LayoutItem because its path data uses absolute points, not relative to a layout rect. To use Path in a layout context, embed it in a Canvas widget.
PathData
PathStyle
PlatformError
Point
PointerButtons
Which pointer buttons are held right now.
PreviewEntry
PreviewSurface
What a preview needs to be rendered the way the runner mounts a surface, rather than as one more widget in the page’s column.
ReactiveList
A reactive list: for item in $items key id (or, keyless, for item in $items) in .rsx. Re-runs its source reactively and reconciles the item widgets — reused keys/positions keep their node/widget, new ones are built, gone ones are disposed, and the layout children are reordered — instead of rebuilding the whole block on every change. new/with_gap reconcile by key (identity-stable); positional/ positional_with_gap reconcile by index (no key clause needed, cheap append/truncate).
ReadSignal
Rect
RectStyle
Rectangle
RendererBuild
What a renderer is built from, beyond the surface it draws on.
RichText
A paragraph of mixed-style text: a sequence of TextRuns (bold, italic, coloured links) shaped and wrapped as one, the multi-style counterpart of Text. The shared paragraph metrics — font size, line height, wrapping, max_lines — come from a base TextStyle; each run overrides only weight, slant, and colour.
RwSignal
Scope
ScrollPage
A window-sized root holding a LayoutScrollArea whose viewport is recomputed on resize, so content scrolls against the current window dimensions.
ScrollViewport
A handle to the enclosing scroll area’s live viewport, handed to the content builder by LayoutScrollArea::new_with. Because a scroll area lays its content out as its OWN layout root, every descendant’s tracked rect is already in the same content-local space the scroll offset indexes into — so visible is a plain rect overlap, no scroll-transform math.
ScrollbarStyle
SegmentNodeInfo
A node emitted by Segment::walk: one mounted component, with its pre-order id, widget name, nesting depth, and the bounding rect of its own draw commands unioned with all descendants’.
Shadow
Slots
The children a component receives from its call site, grouped by slot. A bare child lands in the default slot (None); a child written with slot:"name" lands in that named slot. Inside the component, the children placeholder drains the default slot and children name:"x" drains the "x" slot — each in call-site order. Draining is one-shot: a slot placeholder consumes its children, so referencing the same slot twice yields an empty list the second time.
Stroke
Stroke style for drawing primitives. Includes join to control how corners are rendered in paths and rects; for line segments join is unused and defaults to Miter.
StyledContainer
SurfaceId
Identifies one surface within a MultiSurfacePlatform run. Assigned by the platform (e.g. one per monitor for a desktop shell). Opaque and cheap to copy.
SurfaceScaffold
A full-viewport scaffold that positions a panel against a screen edge, optionally dims the area behind it, and dismisses on a press outside the panel. It is the reusable body of a drawer/modal: a shell mounts it as the root of a full-screen layer-shell surface, and a windowed app can mount it in-tree as an in-window portal — both get the same positioning and dismiss behaviour.
SurfaceTransition
The one progress value a surface’s arrival and departure share: 0 is off its edge and transparent, 1 is settled. Opening runs it to 1; leave runs it back to 0, so the exit is the entrance reversed rather than a second animation that has to be kept in step with the first.
Task
A spawned task or stream. Dropping it detaches — the work keeps running and its callback keeps firing. Keep it to cancel when whatever the callback would write is going away.
Text
TextArea
A multi-line editable text area bound to a RwSignal<String> — the multi-line sibling of Input. A base primitive: unstyled (wrap it in a box for a border/background), keyboard-driven, no soft-wrap (only \n breaks lines, so long lines overflow horizontally). It requests focus on tap, positions the caret at the click, edits the bound signal from key events (typing, Enter for a newline, Backspace/Delete joining lines, arrows in all four directions, Home/End, Tab), and draws a caret. Its measured height grows with the line count, so wrapping it in a LayoutScrollArea gives a scrolling editor. Selection (Shift+arrows, Ctrl+A, shift-click) with copy, cut and paste, newlines and all. IME is not yet supported.
TextRun
One inline run of a rich-text paragraph: a slice of text with its own weight, slant, and colour. Paragraph metrics (font size, line height, wrapping, alignment) live on the DrawCommand::RichText base style, so a run overrides only what varies inline (bold, italic, a link’s colour).
TextStyle
TextureUi
A Telar UI composed into an application-owned texture. See the module docs.
Transform
A 2D affine transform stored as a 2×3 matrix [a, b, c, d, e, f], mapping a point (x, y) to (a*x + c*y + e, b*x + d*y + f). This is the same [f32; 6] layout consumed by RenderNode::transform_with, so to_array() plugs in directly. Compose with Transform::then instead of multiplying matrices by hand.
VirtualList
A keyed list that builds only the rows currently on screen.
WindowConfig
WindowRoot
Lays its content out against the window, because nothing above it will.

Enums§

AvailableSpace
The amount of space available to a node in a given axis https://www.w3.org/TR/css-sizing-3/#available
Axis
Which way a strip runs. Not layout_core::Direction, which is text direction (LTR/RTL) and answers a different question.
BorderWidths
How thick a rect’s border is on each side.
ChildSlot
One child position in a container: a fixed widget, or a reactive fragment (built lazily once the host node exists). Produced by ChildSlot::stat / fragment / fragment_positional.
ClipAxis
Which of a ClippedItem’s own edges do the cutting.
ControlSize
How large the controls in this part of the tree are, in the sense SwiftUI’s controlSize means: a preference the container expresses and each control interprets, not a size any one of them is given.
Cursor
The pointer shape over a window. In a modeller the cursor is the mode indicator — whether the next press orbits, resizes a panel or places a point — so the set covers the gestures a desktop app arms rather than the platform’s full catalogue.
Direction
The writing direction the layout resolves logical edges against.
DrawCommand
Edge
Which side of the viewport a SurfaceScaffold pins its panel to, and the direction it slides in from.
Event
EventResult
FillRule
FullscreenMode
GlyphRaster
Which grid the glyphs are rasterized onto.
GradientKind
ImageFilter
Key
KeyNavMove
What a key press means to a list.
LayoutError
LineCap
LineJoin
NamedKey
ObjectFit
How a sized piece of content (an image or SVG) is scaled into its layout box, mirroring CSS object-fit.
Paint
PathVerb
PointerButton
PointerSource
RawDisplayHandle
A display server handle for a particular windowing system.
RawWindowHandle
A window handle for a particular windowing system.
RenderNode
RendererError
ScrollDelta
SizeDimension
TemplateTrack
TextAlign
Horizontal alignment of text within its box. Start is the writing-direction start (left in LTR).
TextureUiError
Why a TextureUi could not be built.
WindowCommand
A window-management action requested by UI code (a custom title bar’s buttons) and applied by the runner to the OS window after event dispatch. Enqueued via push_window_command and drained via take_window_commands; kept as data (rather than direct Window calls) because widget closures run deep in the tree walk with no access to the platform window.
WindowPosition

Constants§

DEFAULT_SCRIM
The default scrim wash: ~35 % black over the content behind a drawer/modal. Rendered as a fill (not an opacity layer) so the panel above it stays fully opaque. Kept as the value a caller reaches for rather than being folded into the scaffold, because SurfaceScaffold now takes the colour itself.

Traits§

AppPathsProvider
Clipboard
Reading and writing the system selection.
Component
Imperative-state components re-render only when on_event returns EventResult::Handled; reactive-state components re-render automatically on signal change.
EventHandler
LayoutItem
MultiSurfacePlatform
A platform that drives N independent surfaces from a single run, each with its own EventHandler — the seam a multi-window app or a desktop shell (a bar/OSD/notification per monitor) needs. It is separate from Platform so the single-surface contract and every existing single-window entry point stay exactly as they are.
Platform
RenderBackend
RendererFactory
Builds the renderer for a surface — the seam an out-of-tree frontend installs to draw Telar’s frames itself.
Scale
ShapeStyle
Source
Anything a derivation — or a widget — can read reactively: either handle on a signal, or a value already derived once.
TextMetrics
How much room a string takes — all a widget tree needs to know about text before anything is drawn.
Theme
ThemeTokens
Opt-in semantic-token contract the built-in component catalogue reads through, so a component can resolve a token without knowing the concrete theme type.
Window
A surface a Telar app runs on, from the loop’s point of view: how big it is, how to ask it to redraw, and the window-management verbs a custom title bar needs.

Functions§

active_mode
Non-reactive read of the active mode id, for the hot-reload snapshot bridge.
anchor_rect
The world-vs-local anchor fallback shared by the anchored menu/select/tooltip panels.
apply_move
Moves the item at from into slot to, where to counts positions in items as it is now — the frame of reference insertion_index answers in. Returns whether anything moved.
batch
begin_batch
box_item
box_transform
Builds the affine matrix for a box’s declarative rotate/scale/translate attributes, pivoting rotation and scale on the box centre. Returns None when every component is identity, so an untransformed box skips the extra transform node entirely.
cache_stats
What the CPU renderer’s caches are holding, and a way to make them let go. Exposed so an app can answer “is the memory in the renderer?” from outside the renderer, which nothing short of a heap profiler could do before. Every rendering thread’s caches, summed by name.
clipboard
The installed backend, or None where there is no clipboard — headless, and Android today.
clipboard_text
The clipboard’s text, or None with no backend installed. The spelling a widget reaches for.
close_overlay
Closes the overlay named id. Note this is not the same as a dismissal: it closes exactly this overlay, where dismiss_top closes whichever is frontmost.
compute_layout
Lays out root against the given space and reflects the result into each node’s rect signal. Collects the (signal, rect) updates while holding the runtime borrow, then applies them in a batch after releasing it — a rect .set() can flush effects, and one of those may itself touch the layout runtime (a reactive list), which would re-enter the borrow.
context
This surface’s context of type T, as the latest build left it. None before anything set one — a widget built outside a surface, which is every unit test.
control_scale
The factor the catalogue’s metric bases carry here — use_control_size resolved to a number, which is the only form a component ever needs it in.
current_direction
Non-reactive read of the active direction, for the layout pass and event handlers.
current_locale
Non-reactive read of the active locale, for the hot-reload snapshot bridge and event handlers.
derive
A value derived from another, recomputed when its source moves.
derive_pair
[derive] over two sources, recomputed when either moves — a label that reads a level and whether it is charging, and has to follow both.
detect_system_locale
The language subtag of the OS locale, from $LC_ALL / $LC_MESSAGES / $LANG (in POSIX precedence), lowercased and stripped of any territory/encoding suffix — e.g. es_ES.UTF-8"es". None when unset or the C/POSIX locale. An app can seed the initial language by passing this to set_locale at startup.
dev_entry
The cargo telar dev-loop entry, for an app that wires its own runner instead of expanding crate::app! — a multi-surface host, or one on an out-of-tree backend, which reaches crate::run_with_platform or crate::run_multi_with_platform directly. app! generates a call to this; anything using rsx_modules! has to make it by hand, and until it does, cargo telar preview/test silently start the real application.
dismiss_depth
Non-subscribing read of how many dismissible overlays are open.
dismiss_top
Dismisses the topmost open overlay, reporting whether there was one.
dispatch_overlays
drag_start
What armed the drag whose callback is running, or None outside one.
drag_travel
How far the drag whose callback is running has been from its press point, at its furthest.
drain_tasks
Runs the callbacks for every value posted since the last call. The runner calls this once per frame, on the UI thread, before App::on_frame.
effect
end_batch
follow_locale_direction
Makes the writing direction follow the active locale, so switching to Arabic or Hebrew mirrors the layout and switching back restores it — no rebuild, the existing nodes are re-resolved on the next layout pass.
follow_system
Drives the active mode from the OS light/dark preference — light → light, dark → dark — updating live as the OS scheme changes. Installs a reactive effect (kept alive internally) and designates the pair so [is_dark] stays consistent. Re-calling replaces the effect (hot reload re-runs setup). A manual set_mode still wins until the next OS change re-drives it.
font_family_available
Whether family names a font installed on this system.
for_each_with_matrix
Iterates cmds calling f(cmd, cumulative_matrix) for every command. PushMatrix/PopMatrix update the matrix before the callback; all other commands see the matrix that was active when they were emitted.
fragment
A keyed reactive region — for item in $items key <expr> (identity-stable reconciliation). gap is laid out as a main-axis leading margin between consecutive items (see [reconcile_slot]), so the region still flows transparently in the host’s direction (horizontal in a row) instead of becoming a boxed list; pass 0.0 for none.
fragment_positional
A keyless reactive region — for item in $items (reconciles by position). gap as in fragment.
hash_draw_commands
hot_signal
Without dev there is no dylib swap to survive, so the key is inert and this degrades to a plain signal. The bounds match the dev build’s so a type that compiles here cannot fail once hot-reload is on — letting hand-written app state (a navigation stack, an active locale) be declared once instead of behind a cfg.
insertion_index
The slot a pointer at point names, given the items’ laid-out rects in display order: the number of items whose centre it has passed.
install_default_text_metrics
Installs the glyph-shaping text measurer, for code that lays out text with no runner behind it — a layout test, or a tool that composes a tree only to measure it.
interactive_rects
The current laid-out rects of every interactive widget on the active surface, dropping any not yet laid out (zero-sized). Read without subscribing (peek), so the platform’s frame loop can call it outside a reactive scope without accidentally tracking the layout signals.
kept
The value this surface keeps under key, built by init the first time it is asked for and handed back unchanged on every build after that.
key_held
Whether key is down right now, however long it has been down.
key_nav_apply
Where a move lands, given the current index and how many rows there are.
key_nav_apply_grid
Where a move lands in a grid columns tiles wide. A single column is a list, which is why key_nav_apply is this with columns = 1 rather than a second implementation.
key_pressed
Whether key went down during this frame. False for a key the OS is repeating, which is what makes it the one to drive a once-per-press action while key_held drives a continuous one.
logical_border_radius
Corner radii where start/end, when given, round the two corners on that edge.
logical_border_widths
Per-side border widths where start/end, when given, land on left or right according to the writing direction.
mark_dirty
memo
modifiers
The modifier keys held right now.
new_container
new_leaf
observe_keyboard
Records what event says about the keyboard. The runner calls this for every event before dispatch.
observe_pointer
Records what event says about the buttons. The runner calls this for every event before dispatch, so a handler running on this very event already sees the state it establishes.
open_overlay
Opens the overlay named id.
overlay_state
The open-state signal for the overlay named id, minted on first use.
pointer_buttons
The pointer buttons held right now.
provide
push_window_command
Enqueue a window-management command from UI code (e.g. a title-bar button’s on_press). The runner drains the queue after event dispatch and applies each command to the OS window. Lives in a thread-local so it works from any widget closure without threading a window handle through the tree; each surface owns its own queue (activated via WindowCommandContext), so commands never cross windows.
register_mode
Registers a named mode. apply installs the concrete theme when the mode is selected. Re-registering an id replaces its closure, which is expected: hot reload re-runs the app’s setup and re-registers every mode.
relayout_if_dirty
Re-lays out every root that has been computed at least once, picking up any nodes a reactive change dirtied since the last frame. Each compute_layout early-returns when its root is clean and the space is unchanged, so this is cheap on a still frame. The runtime calls it once per redraw (after flushing reactive effects, before rendering) so a data change deep in the tree — e.g. a reactive list adding an item — is reflected in layout without the app shell knowing about it. Node dirtiness propagates up to the root through taffy, so a dirtied list container makes its root recompute.
remove_node
Detaches and frees node (a former list item) from the runtime: removes it from the layout tree and drops its rect signal and bookkeeping. The caller must have removed it from its parent’s child list (via set_children) first.
reset_layout_runtime
Empties the layout runtime for a fresh tree, and installs the glyph measurer if nothing installed one.
reset_runtime
reset_tasks
Stops the worker pool and drops every pending callback. Called before a hot-reload dylib is closed: its threads are parked in, and its callbacks are made of, code that is about to be unmapped.
set_catalog
Installs the catalog t looks in. Process-wide and replaceable — a language pack loaded later takes over from here on.
set_children
Replaces parent’s children with children, in order, marking parent dirty. Operates on the thread-local runtime; parent must be a container already registered in the runtime.
set_clipboard
Installs the backend the app’s clipboard goes through. The desktop runner calls this at startup; a shell that speaks the protocol itself installs its own, and a test can install a stub. The first call wins.
set_clipboard_text
Puts text on the clipboard if there is one. A no-op otherwise, which is the honest answer for a headless run: nothing to copy to.
set_context
Sets this surface’s context of type T — what its content wants every widget under it to be able to read without being handed it: which page a panel shows, which screen a chip is on.
set_control_size
Sets the ambient control size. Reactive: everything that read it re-runs, so a switch re-spaces the controls already on screen rather than waiting for whatever rebuilds them.
set_default_text_metrics
Installs metrics only if nothing is installed yet, and reports whether it took.
set_direction
Sets the writing direction every surface lays out against, taking effect on the next layout pass.
set_display
Shows or hides a node in layout flow. A hidden node takes no space (and lays out none of its subtree); mark an ancestor dirty and recompute for the change to take effect. Used for responsive layouts (e.g. collapsing a sidebar on narrow windows).
set_locale
Sets the active locale (a BCP-47 tag such as "en" or "es"), re-rendering every translated string that reads it. The tag should be one of the baked catalog’s locales; an unknown tag simply falls back to the catalog’s default locale at lookup time.
set_min_height
Sets node’s minimum height to px after the initial layout (dirtying it, which propagates up), so a content-measured leaf grows to at least px even when its content is shorter. A scrolling editor uses it to fill its viewport so a click anywhere in the empty area — not just over the text — lands on the leaf.
set_mode
Selects a mode: runs its registered apply closure (if one is registered) and publishes the id to the reactive active-mode signal. Setting an unregistered id still updates the signal, so an app may drive the theme from its own effect on [use_mode] instead of registering closures.
set_overlay_host
set_system_dark
Reports the OS light/dark preference into the reactive graph. Called by the runner at window creation and whenever the OS scheme changes; drives follow_system.
set_task_waker
Installs the process-global “wake the UI loop” used after a task posts a value. The runner passes the same wake an app gets from AppCtx::redraw_waker.
set_text_metrics
Installs the process-wide text measurer, replacing whatever was there.
set_theme
signal
spawn_stream
Runs work on a background thread, handing it an Emitter, and runs on_item on this thread for every item it emits — in order, during the frames that follow. on_end runs once the worker returns.
spawn_task
Runs work on a background thread and on_done with its result on this thread, during a later frame’s drain_tasks.
sweep_renderer_caches
What the CPU renderer’s caches are holding, and a way to make them let go. Exposed so an app can answer “is the memory in the renderer?” from outside the renderer, which nothing short of a heap profiler could do before. Drops everything no frame has asked for within each cache’s idle horizon.
take_window_commands
Drain every queued window command. Called by the runner once per event-dispatch cycle.
track_layout
transform_clip_rect
Maps clip rect r (in the currently-active transform’s local space) to window space — the axis-aligned bounds of its four mapped corners. Widgets emit clip rects in their own local space, but the renderer clips in window space, so a clip must be mapped through the active cumulative matrix (scroll/layout translations) to compose correctly.
transform_pointer
Applies the full affine inverse of matrix to all pointer-coordinate events. Returns None for non-pointer events or when matrix is degenerate (det ≈ 0), so callers fall back to the original.
try_inject
try_run_test
Renders every preview component headlessly (build → layout → flatten) and exits with a non-zero code if any panics or returns a layout error. Backs cargo telar test, entered via the TELAR_TEST env var set on the app binary.
use_context
The nearest enclosing value of type T that a parent provided, or None outside any such parent.
use_control_size
The ambient control size, subscribing the caller.
use_direction
Reactive read of the active direction — subscribes the caller, for the rare widget that has to mirror something layout cannot flip on its own (a chevron glyph, a directional icon).
use_dismiss_depth
Reactive read of how many dismissible overlays are open — for styling an affordance on whether a dismissal would do anything.
use_locale
Reactive read of the active locale — subscribes the caller so translated text re-renders on switch. None before any locale is set (callers fall back to the catalog’s default locale).
use_theme
use_theme_tokens
visible_window
Which slice of a long list is worth building, given where the viewport currently is.
with_service

Type Aliases§

JustifyContent
Sets the distribution of space between and around content items. For Flexbox it controls alignment in the main axis. For Grid it controls alignment in the inline axis.
NodeId

Derive Macros§

ThemeTokens
Implements Theme and ThemeTokens for a theme struct, mapping each token to the field of the same name.