zaxis 0.1.0

API index

Exported types and method groups with direct links to their contracts.

Crate-root exports

Types / functionsContract
run, run_with_options, App, Frame, RunOptions, RunErrorDesktop runner
Context, EventResponse, InputState, InputStatsContext below, Input, Custom host
KeyInterest, KeyEventKeys a focused widget owns and the events it receives: Keys for a widget, Custom widgets
FocusGroup, FocusGroupOutput, FocusAxisOne Tab stop and arrow-key navigation for several controls: Focus groups
Diagnostic, DiagnosticKind, DebugOverlayDiagnostics
IdIDs and retained state
Ui, Widget, Response, SenseUi below, Components, Input, Custom widgets
Field, Validation, SemanticStatusField and validation
Dock, DockState, DockNode, DockChild, DockFloat, PanelId, DockViewer, DockOutput, DockPanelOutput, DockEvent, DockSide, DockDropZone, DockStyle, DockPreset, DockMotion, DockActions, DockError, DockIssueIDE panel workspace
WindowPanel builders and geometry
Grid, GridUi, GridRow, GridStyle, GridOutput, Column, ColumnWidth, AlignShared column layout
Table, TableBody, TableStyle, TableOutput, SortRequest, SortDirectionData table composition
ScrollArea, ScrollAreaOutput, ScrollStyleScroll viewports and virtualization
PanZoom, PanZoomState, PanZoomOutput, ZoomWheelApplication camera and local content
Popup, PopupOutput, MAX_POPUP_DEPTHOverlay layers and dismissal
Modal, ModalOutput, ModalAnchor, ModalStyle, CloseReason, Dialog, DialogAction, DialogOutput, Confirm, ConfirmationModal dialogs, confirmations and sheets
ComboBox, ComboBoxOption, ComboBoxStyleSelection and filtering
Tooltip, TooltipWidget, ContextMenu, ContextMenuWidgetTooltip, ContextMenu
TextText builders and fonts
TextEditSingle-line editing and IME
ButtonButton builders and activation
CheckboxBoolean binding
SwitchAnimated on/off binding
DragSource, DropTarget, DragOutput, DropOutput, Dropped, DragEnd, DragReason, DragStyle, DropZones, InsertionTyped in-window drag and drop
Slider, SliderStatusNumeric binding
ColorPicker, ColorPickerTypeColor selection
SeparatorDividing lines
StyleTheme fields and defaults
Animation, Interpolate, Easing, Decay, DecayOptions, Oklab, Path, PathFollow, PathPose, Tween, TweenOptions, Keyframes, Keyframe, Repeat, Procedural, WakeAnimation tracks and extension contracts
Animated, AnimationStatus, AnimationSample, AnimationOptions, MotionStyleAnimation state, scheduling and style
Layout, PaddingLayout and insets
Rect, RectShape, Shape, Border, CornerRadius, ColorDrawing, Color
DrawData, GeometryUpdate, DrawCommand, Vertex, TextureId, TextureImageDrawing protocol
Material, MaterialId, MaterialPaint, MaterialError, MaterialErrorKind, ParamKind, ParamLayout, ParamValue, Params, MaterialDraw, MaterialSource, MAX_MATERIALS, MAX_UNIFORM_BYTES, MAX_PARAM_BYTES, FRAME_BYTESMaterials
Renderer, RenderError, RenderStatus, PresentationModeRenderer
EmbeddedRenderer, EmbedOptions, EmbedAlpha, EmbedColorSpace, EmbedViewport, EmbedLoad, PhysicalRect, RecordReport, EmbedErrorEmbedding in a wgpu host
CacheStats, RendererStatsPerformance counters
Vec2, vec2glam two-dimensional vectors
winit, wgpuIntegration-crate re-exports

Context

One context holds UI state for one native viewport.

MethodReturns / purpose
Context::new() / default()Bundled font and default style
Context::with_font(FontArc)Custom single-weight font context
Context::with_fonts(FontFamily)Custom family with a file per weight; see Text and fonts
run(build: impl FnOnce(&mut Context))bool, currently always true; complete UI pass
run_at(Instant, build), frame_time(), needs_repaint_at(Instant)Deterministic monotonic host clock
transition, transition_from, animate, animate_withRetained visible animation channels
sample_animation, animation_status, pause_animation, resume_animation, cancel_animation, finish_animation, restart_animation, restart_animation_withAnimation sampling and controls
transition_smoothVelocity-preserving property transition
set_animation_rate, reverse_animation, seek_animation, animation_elapsed, animation_rate, animation_durationPlayback rate, direction and scrubbing
on_window_event(&WindowEvent)EventResponse; process native input immediately (converts with InputEvent::from_window_event and calls on_input)
on_input(InputEvent)EventResponse; the one input entry point, with no window or event loop: PointerMoved, Button, Wheel, Key, Modifiers, Ime, Focus, Resized, ScaleFactor, file drop; see Input
on_key_event(KeyCode, ElementState, bool)EventResponse; physical key bridge, with repeat flag; text/modifiers supplied separately; the event's logical key is unidentified
sync_ime(&Window)Enable and position native IME after a custom host UI pass
ime_cursor_area()Optional logical composition window anchor
request_focus(Id), close_popup(), close_popup_branch()Move widget focus; close the leaf popup, or the whole branch of nested popups, and restore focus
diagnostics(), set_diagnostic_handler(..), set_debug_overlay(DebugOverlay), debug_overlay()Usage diagnostics and the debug overlay
on_text_event(&str)EventResponse; committed text bridge for TextEdit and editable color fields
input()&InputState; read accumulated input during the callback (idle outside an open modal)
cursor_icon()Native winit::window::CursorIcon for the hovered/captured region; applied automatically by the runner
style() / set_style(Style)&Style / replace style and request repaint
set_viewport(PhysicalSize<u32>, f64)Set physical size and DPI; request repaint on change
viewport()Rect in logical coordinates
scale_factor()f32 physical pixels per logical pixel
draw_data()&DrawData from the most recent completed pass
request_repaint()Schedule another pass
request_repaint_after(Duration)Record the earliest future deadline
needs_repaint()bool; pending immediate request or elapsed deadline
next_repaint()Option<Instant>
wants_animation_frame()Continuous visible motion; Vsync hosts request the next presented frame
cache_stats()CacheStats snapshot
input_stats()InputStats: key claims, events waiting, held keys owned, events dropped, focus groups and members; bounded counters for profiling and tests

set_viewport substitutes 1 for a nonpositive or nonfinite input scale. Use ordinary finite positive DPI values; renderable logical viewport and scale are validated by the renderer. Context exposes no public per-widget hit registration, mesh painting, or retained-window reset API.

Ui

Created by Window::show; construction fields are private.

MethodReturns / purpose
add(impl Widget)Response; apply automatic follow-up repaint
interact(Rect, impl Hash, Sense)Response for custom geometry through the shared hit path; see Custom widgets
keys(&Response, KeyInterest)Vec<KeyEvent>; own these keys while the widget has focus and take its events (claim_keys declares, take_keys takes)
focus_entry(&Response)Inside a FocusGroup: the item Tab lands on from outside
add_enabled_ui(bool, build)Closure result; the one way to disable a group (.enabled(bool) for one control)
add_enabled(bool, impl Widget)Deprecated; use add_enabled_ui or .enabled
is_enabled()bool; effective enabled state
label(text)Response; add Text
text_edit(&mut String)Response; add a single-line editor
muted(text)Response; add text in Style::muted_text
heading(text), title(text), small(text), typography(role, text)Response; text at the theme's type scale
tooltip(Response, text)Attach a hint to a built response; widget.tooltip(text) does it in one expression
context_menu(Response, &items)ContextMenuOutput; widget.context_menu(&items) does it in one expression
button(text)Response; add Button
button_enabled(bool, text)Deprecated; Button::new(text).enabled(bool)
selectable(bool, text)Response; selected button appearance
selectable_value(&mut T, T, text)Response; update selection and report changed()
tab_bar(&mut T, (T, label) iterator)Vec<Response>; tabs bound to a selection, scrolling horizontally when they do not fit
tab_pages(source, usize, Vec2, build)Fixed-size directed page transitions, latest pending selection
animation_id, transition, transition_from, animate, animate_withScoped application animation channels
checkbox(&mut bool, text)Response; add Checkbox
checkbox_enabled(bool, &mut bool, text)Deprecated; Checkbox::new(..).enabled(bool)
switch(&mut bool, text)Response; add Switch
switch_enabled(bool, &mut bool, text)Deprecated; Switch::new(..).enabled(bool)
drag_source(Id, payload, build)DragOutput<R>; make content draggable
drop_target(Id, accept, build)DropOutput<R, P>; accept payloads of type P
dragging(), keep_drag_source(Id)Active source id; keep a virtualized source alive
slider(&mut T, RangeInclusive<T>)Response; add Slider for f32 or any Numeric
slider_enabled(bool, &mut T, range)Deprecated; Slider::new(..).enabled(bool)
slider_labeled(&mut T, range, text)Response; caption and value below track
combo_box_values(&mut T, (T, label) iterator)Response; combo box bound to a value, ids from the values
color_picker(&mut Color, text)Response; expandable internal color editor
separator()Response; add horizontal Separator
horizontal(build)Closure result; nest a horizontal row
grid(source, columns, build)GridOutput<R>; shared columns with stable row keys
vertical(build)Closure result; nest a vertical column, including inside a row
push_id(impl Hash, build)Closure result; scope child IDs
style()&Style
context()&mut Context
available_width()f32; remaining logical width
clip_rect()Rect; logical content clip
add_space(f32)Advance layout cursor
allocate_space(Vec2)Rect; reserve custom geometry
paint(impl Into<Shape>)Add cached vector shape or RectShape builder

Widget::ui(self, &mut Ui<'_>) -> Response consumes the widget. Widget::tooltip(text) and Widget::context_menu(&items) wrap any widget. Response is Copy; geometry and hover/press/focus fields are public and events (clicked, double_clicked, secondary_clicked, drag_started, dragged, drag_delta, drag_stopped, gained_focus, lost_focus, changed, submitted, menu_selected) are methods, see Input. Use Ui::add to preserve automatic repaint behavior for custom widgets.

Public modules

ModuleContents
appDesktop runner types and functions
componentsComponents, Ui, Widget, Response, Style; per-component submodules
contextContext, Id, input and CPU cache counters
layoutLayout, Padding
protocolFrame, vertex, command, texture protocol
rendererGPU renderer, errors, statuses, presentation, GPU counters
shapesDrawing primitives; compatibility re-exports of four protocol types
widgetsCompatibility re-export of all components

The internal text engine and context/renderer implementation submodules are private. Generate compiler-linked API documentation locally with:

cargo doc --no-deps --open

Scroll containers also expose Ui::scroll_vertical, Ui::scroll_to_rect, Ui::scroll_to_response, and Ui::available_height. See ScrollArea.

Dock

Ui::dock(&mut DockState, viewer) and Dock::new(id_source, &mut state) build application-owned panel trees. Builder options: style, size, name, actions and show. See Dock for model operations, output, floating windows and the versioned save / load format.

Edit on GitHub

On this page