Expand description
Declarative UI runtime and extension APIs.
§Usage
Compose with tessera, defer child content with RenderSlot, and own data with State.
Re-exports§
pub use crate::accessibility::AccessibilityActionHandler;pub use crate::accessibility::AccessibilityId;pub use crate::accessibility::AccessibilityNode;pub use crate::asset::Asset;pub use crate::asset::FontAsset;pub use crate::asset::LoadState;pub use crate::asset::Resource;pub use crate::asset::Source;pub use crate::clip::ClipRegion;pub use crate::clip::ClipShape;pub use crate::clip::ui_stencil_state;pub use crate::clipboard::ClipboardAction;pub use crate::clipboard::ClipboardInput;pub use crate::clipboard::ClipboardInputModifierNode;pub use crate::clipboard::ClipboardResponse;pub use crate::clipboard::ClipboardWrite;pub use crate::clipboard::request_clipboard_action;pub use crate::color::Color;pub use crate::context::Context;pub use crate::context::provide_context;pub use crate::context::use_context;pub use crate::dp::Dp;pub use crate::entry_point::EntryPoint;pub use crate::entry_registry::EntryRegistry;pub use crate::entry_registry::TesseraPackage;pub use crate::focus::FocusDirection;pub use crate::focus::FocusGroupNode;pub use crate::focus::FocusManager;pub use crate::focus::FocusProperties;pub use crate::focus::FocusRequester;pub use crate::focus::FocusRestorationTarget;pub use crate::focus::FocusScopeNode;pub use crate::focus::FocusState;pub use crate::focus::FocusTraversalPolicy;pub use crate::focus::FocusTraversalStrategy;pub use crate::geometry::FloatRect;pub use crate::geometry::LayoutCoordinates;pub use crate::geometry::LocalToWindow;pub use crate::geometry::scaled_box;pub use crate::layout::DefaultLayoutNode;pub use crate::layout::DrawModifierHandle;pub use crate::layout::LayoutModifierHandle;pub use crate::layout::LayoutResult;pub use crate::layout::NoopDrawModifier;pub use crate::layout::RenderInput;pub use crate::layout::RenderMetadataMut;pub use crate::modifier::BuildModifierNode;pub use crate::modifier::CursorModifierExt;pub use crate::modifier::CursorModifierNode;pub use crate::modifier::DrawModifierContent;pub use crate::modifier::DrawModifierContext;pub use crate::modifier::DrawModifierNode;pub use crate::modifier::FocusModifierExt;pub use crate::modifier::ImeInputModifierNode;pub use crate::modifier::KeyboardInputModifierNode;pub use crate::modifier::LayoutModifierChild;pub use crate::modifier::LayoutModifierInput;pub use crate::modifier::LayoutModifierNode;pub use crate::modifier::Modifier;pub use crate::modifier::ModifierBuildContext;pub use crate::modifier::ParentDataMap;pub use crate::modifier::ParentDataModifierNode;pub use crate::modifier::PlacementModifierNode;pub use crate::modifier::PointerInputModifierNode;pub use crate::modifier::SemanticsModifierNode;pub use crate::pipeline_context::PipelineContext;pub use crate::plugin::DesktopPlatformContext;pub use crate::plugin::DesktopWindowAction;pub use crate::plugin::Plugin;pub use crate::plugin::PluginContext;pub use crate::plugin::PluginResult;pub use crate::plugin::register_plugin;pub use crate::plugin::register_plugin_boxed;pub use crate::plugin::try_with_plugin;pub use crate::plugin::try_with_plugin_mut;pub use crate::plugin::with_plugin;pub use crate::plugin::with_plugin_mut;pub use crate::px::Px;pub use crate::px::PxPosition;pub use crate::px::PxRect;pub use crate::px::PxSize;pub use crate::render_module::RenderModule;pub use crate::render_scene::Command;pub use crate::render_scene::DrawRegion;pub use crate::render_scene::PaddingRect;pub use crate::render_scene::SampleRegion;pub use crate::renderer::Renderer;pub use crate::renderer::compute;pub use crate::renderer::compute::ComputablePipeline;pub use crate::renderer::compute::ComputeCommand;pub use crate::renderer::compute::ComputePipelineRegistry;pub use crate::renderer::core::OffscreenReadbackError;pub use crate::renderer::drawer;pub use crate::renderer::drawer::DrawCommand;pub use crate::renderer::drawer::DrawablePipeline;pub use crate::renderer::drawer::PipelineRegistry;pub use crate::renderer::drawer::command;pub use crate::scroll::PlatformScrollConfig;pub use crate::scroll::normalize_platform_scroll_delta;pub use crate::scroll::platform_scroll_config;pub use crate::headless::HEADLESS_ENV;pub use crate::headless::HEADLESS_FRAME_TIME_MS_ENV;pub use crate::headless::HEADLESS_HEIGHT_ENV;pub use crate::headless::HEADLESS_WIDTH_ENV;pub use crate::headless::HeadlessConfig;pub use crate::headless::HeadlessError;pub use crate::headless::HeadlessRenderer;pub use crate::headless::encode_png_rgba;pub use crate::headless::headless_mode_requested;pub use crate::headless::run_headless;pub use crate::headless::write_png_file;pub use window_insets::Insets;pub use window_insets::WindowInsets;pub use window_insets::WindowInsetsController;pub use accesskit;pub use wgpu;pub use winit;
Modules§
- accessibility
- Accessibility Support
- asset
- On-demand resources owned by a UI session.
- clip
- Shape clipping for rendered content and pointer input.
- clipboard
- Focused clipboard input and platform replies.
- color
- Linear sRGB colors.
- context
- Context provider
- dp
- Density-independent layout units.
- entry_
point - Application entry builder for registering packages and launching the renderer.
- entry_
registry - Entry package registry for renderer startup.
- focus
- Focus ownership, traversal, and restoration for interactive UI.
- geometry
- Fractional geometry and uniform coordinate transformations.
- headless
- Offscreen rendering, input injection, and resource observations.
- layout
- Layout policies and measurement.
- modifier
- Modifier chains for node-local layout, drawing, focus, semantics, and other node-scoped behavior.
- nested_
scroll - Nested scrolling through attached layout ancestry.
- pipeline_
context - Pipeline registration context for renderer initialization
- plugin
- Plugin lifecycle hooks for Tessera platform integrations.
- px
- Physical pixel geometry.
- render_
module - Custom GPU pipelines.
- render_
scene - Render command definitions for frame graphs
- renderer
- The core rendering system for the Tessera UI framework. This module provides
the main
Rendererstruct that manages the application lifecycle, event handling, and rendering pipeline for cross-platform UI applications. - scroll
- Platform scroll delta normalization helpers.
- system_
back - Application handling for Android system back navigation.
- time
- Cross-platform clocks for elapsed time and calendar dates.
- window_
insets - Window safe areas and keyboard occlusion. Window safe areas and on-screen keyboard occlusion.
Structs§
- Arena
- An
Arenastructure containing certain [Node]s. - Axis
Constraint - A single-axis layout constraint expressed as an allowed interval.
- Callback
- Stable, comparable callback handle for
Fn(). - Callback
With - Stable, comparable callback handle for
Fn(T) -> R. - Component
Tree - Respents a component tree
- Computed
Data - Layout information computed at the measure stage, representing the size of a node.
- Constraint
- A two-dimensional interval constraint.
- Draw
Geometry - Local drawing dimensions and their precise placement in the render target.
- Frame
Buffer - A distinct buffer range for commands recorded in the current frame. Its contents must not be used by a later frame.
- Frame
Clock Diagnostics - Frame-clock work performed by a completed frame.
- Frame
Work - Actual work in a completed frame.
- Graphics
Device - A graphics service bound to one renderer’s device and upload queue.
- Graphics
Work - Actual resource operations for a pipeline’s declared resource group.
- Graphics
Work Diagnostics - Cumulative graphics work owned by one renderer.
- ImeInput
- Input for IME handlers.
- ImeRequest
- A request to the windowing system to open an Input Method Editor (IME). This is typically used for text input components.
- ImeSession
- Publishes the focused editor’s text, selection and input configuration.
- Keyboard
Event - An owned keyboard sample accepted from a window or synthetic input.
- Keyboard
Input - Input for keyboard handlers.
- NodeId
- A node identifier within a particular
Arena. - Parent
Constraint - The constraint inherited from a parent node during measurement.
- Pointer
Change - Represents a single pointer change with timing information.
- Pointer
Input - Input for pointer handlers.
- Render
Fragment - A per-component render fragment.
- Render
Fragment Op - A single render op inside a fragment.
- Render
Graph - Frame-level render graph.
- Render
Graph Op - A render op after merging into the frame graph.
- Render
Slot - Owned UI content expanded by its parent during a Tessera build.
- Render
Slot With - Stable, comparable render slot handle for
Fn(T). - Runtime
Session - An owner for the resources of one UI session.
- Runtime
Session Guard - Restores the previous active session when a scoped operation finishes.
- Runtime
Session Id - The identity shared by observations from one runtime session.
- Scratch
Texture - A pooled texture. Work recorded after it is dropped may reuse it, so keep it until all work that uses its contents is recorded.
- Scratch
Texture Descriptor - Describes a pooled texture requested with
GraphicsDevice::scratch_texture. - Scroll
Event Content - Contains scroll movement data for scroll events.
- Slot
- Stable, comparable slot handle for any shared callable trait object.
- State
- Handle to memoized state created by
rememberandremember_with_key. - State
Owner - Owns reactive state for a controller, route, or other explicit UI lifetime.
- Tracked
Buffer - A buffer whose resource group and renderer owner stay attached to uploads.
- UiDispatcher
- A captured delivery service for one UI session.
- Weak
Runtime Session - A non-owning reference used to deliver results to a live UI session.
- Work
Execution - One component, policy, or modifier execution.
- Work
Totals - Cumulative work during a renderer or test session’s lifetime.
Enums§
- Cursor
Event Content - Enumeration of all possible cursor event types.
- Frame
Nanos Control - Control flow for
receive_frame_nanoscallbacks. - Gesture
State - Describes the high-level gesture classification of a cursor event.
- Measurement
Error - Represents errors that can occur during node measurement.
- Pointer
Event Pass - Pointer input dispatch pass.
- Press
KeyEvent Type - Represents the different types of cursor buttons or touch interactions.
- Scratch
Fit - How a scratch texture’s size relates to the requested size.
- Scroll
Delta Unit - Indicates the unit used by the platform to describe a scroll delta.
- Scroll
Event Source - Indicates the input source for a scroll event.
- Work
Phase - A runtime execution phase.
Constants§
- MOUSE_
POINTER_ ID - Pointer identifier reserved for mouse input.
Traits§
- Send
Sync - Thread-safety bound for abstractions that own GPU resources.
Functions§
- current_
frame_ nanos - Returns the current frame timestamp in nanoseconds from runtime origin.
- current_
frame_ time - Returns the timestamp of the current frame, if available.
- frame_
delta - Returns the elapsed time since the previous frame.
- key
- Groups the execution of a block of code with a stable key.
- receive_
frame_ nanos - Register a per-frame callback driven by the renderer’s frame clock.
- remember
- Initializes state by call order and control-flow position during a component build.
- remember_
with_ key - Initializes state by an explicit key within the current component build.
- retain
- Initializes state by call order during a build, retaining it until unmount.
- retain_
with_ key - Initializes keyed state during a build and keeps it until the component unmounts.
Type Aliases§
- ImeInput
Handler Fn - IME-specific input handler.
- Keyboard
Input Handler Fn - Keyboard-specific input handler.
- Pointer
Id - Pointer identifier used by input changes.
- Pointer
Input Handler Fn - Pointer-specific input handler.