Skip to main content

Crate tessera_ui

Crate tessera_ui 

Source
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 Renderer struct 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 Arena structure containing certain [Node]s.
AxisConstraint
A single-axis layout constraint expressed as an allowed interval.
Callback
Stable, comparable callback handle for Fn().
CallbackWith
Stable, comparable callback handle for Fn(T) -> R.
ComponentTree
Respents a component tree
ComputedData
Layout information computed at the measure stage, representing the size of a node.
Constraint
A two-dimensional interval constraint.
DrawGeometry
Local drawing dimensions and their precise placement in the render target.
FrameBuffer
A distinct buffer range for commands recorded in the current frame. Its contents must not be used by a later frame.
FrameClockDiagnostics
Frame-clock work performed by a completed frame.
FrameWork
Actual work in a completed frame.
GraphicsDevice
A graphics service bound to one renderer’s device and upload queue.
GraphicsWork
Actual resource operations for a pipeline’s declared resource group.
GraphicsWorkDiagnostics
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.
KeyboardEvent
An owned keyboard sample accepted from a window or synthetic input.
KeyboardInput
Input for keyboard handlers.
NodeId
A node identifier within a particular Arena.
ParentConstraint
The constraint inherited from a parent node during measurement.
PointerChange
Represents a single pointer change with timing information.
PointerInput
Input for pointer handlers.
RenderFragment
A per-component render fragment.
RenderFragmentOp
A single render op inside a fragment.
RenderGraph
Frame-level render graph.
RenderGraphOp
A render op after merging into the frame graph.
RenderSlot
Owned UI content expanded by its parent during a Tessera build.
RenderSlotWith
Stable, comparable render slot handle for Fn(T).
RuntimeSession
An owner for the resources of one UI session.
RuntimeSessionGuard
Restores the previous active session when a scoped operation finishes.
RuntimeSessionId
The identity shared by observations from one runtime session.
ScratchTexture
A pooled texture. Work recorded after it is dropped may reuse it, so keep it until all work that uses its contents is recorded.
ScratchTextureDescriptor
Describes a pooled texture requested with GraphicsDevice::scratch_texture.
ScrollEventContent
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 remember and remember_with_key.
StateOwner
Owns reactive state for a controller, route, or other explicit UI lifetime.
TrackedBuffer
A buffer whose resource group and renderer owner stay attached to uploads.
UiDispatcher
A captured delivery service for one UI session.
WeakRuntimeSession
A non-owning reference used to deliver results to a live UI session.
WorkExecution
One component, policy, or modifier execution.
WorkTotals
Cumulative work during a renderer or test session’s lifetime.

Enums§

CursorEventContent
Enumeration of all possible cursor event types.
FrameNanosControl
Control flow for receive_frame_nanos callbacks.
GestureState
Describes the high-level gesture classification of a cursor event.
MeasurementError
Represents errors that can occur during node measurement.
PointerEventPass
Pointer input dispatch pass.
PressKeyEventType
Represents the different types of cursor buttons or touch interactions.
ScratchFit
How a scratch texture’s size relates to the requested size.
ScrollDeltaUnit
Indicates the unit used by the platform to describe a scroll delta.
ScrollEventSource
Indicates the input source for a scroll event.
WorkPhase
A runtime execution phase.

Constants§

MOUSE_POINTER_ID
Pointer identifier reserved for mouse input.

Traits§

SendSync
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§

ImeInputHandlerFn
IME-specific input handler.
KeyboardInputHandlerFn
Keyboard-specific input handler.
PointerId
Pointer identifier used by input changes.
PointerInputHandlerFn
Pointer-specific input handler.

Attribute Macros§

entry
Generates platform-specific entry points from a shared run function.
lint
Sets Tessera lint levels for an item or inline module tree.
tessera
Transforms a regular Rust function into a Tessera UI component.