Skip to main content

Crate compose_rust

Crate compose_rust 

Source

Re-exports§

pub use asset::asset;
pub use boundary::Host;
pub use boundary::LaunchBuilder;
pub use boundary::MutationBatch;
pub use boundary::RendererApi;
pub use boundary::demo_theme;
pub use boundary::demo_theme_for;
pub use boundary::install_renderer_api;
pub use boundary::launch;
pub use boundary::request_frame_from_worker;
pub use brush::Brush;
pub use brush::Stop;
pub use brush::brush;
pub use design::design_system;
pub use design::use_design_system;
pub use drawing::DrawCommand;
pub use drawing::DrawList;
pub use drawing::DrawListBuilder;
pub use extensions::LinearProgressIndicator;
pub use extensions::LinearProgressIndicator;
pub use message::Message;
pub use message::show_message;
pub use schema::Alignment;
pub use schema::Arrangement;
pub use schema::AssetKind;
pub use schema::ButtonVariant;
pub use schema::Chrome;
pub use schema::Color;
pub use schema::ColorRole;
pub use schema::ColorScheme;
pub use schema::DesignSystem;
pub use schema::EventPayload;
pub use schema::IconRole;
pub use schema::Key;
pub use schema::LoopMode;
pub use schema::MaterialRole;
pub use schema::MessageDuration;
pub use schema::Modifier;
pub use schema::MotionRole;
pub use schema::Paint;
pub use schema::PropertyKind;
pub use schema::SCHEMA_HASH;
pub use schema::Selection;
pub use schema::ShapeRole;
pub use schema::SpaceRole;
pub use schema::TextAlign;
pub use schema::TextOverflow;
pub use schema::Theme;
pub use schema::TileMode;
pub use schema::TypeRole;
pub use schema::WidgetKind;
pub use schema::WindowHeightClass;
pub use schema::WindowSizeClass;
pub use widgets::Badge;
pub use widgets::Badge;
pub use widgets::Button;
pub use widgets::Button;
pub use widgets::Canvas;
pub use widgets::Canvas;
pub use widgets::Card;
pub use widgets::Card;
pub use widgets::Checkbox;
pub use widgets::Checkbox;
pub use widgets::Column;
pub use widgets::Column;
pub use widgets::ComposeBox as Box;
pub use widgets::ComposeBox as Box;
pub use widgets::DatePicker;
pub use widgets::DatePicker;
pub use widgets::Dialog;
pub use widgets::Dialog;
pub use widgets::Divider;
pub use widgets::Divider;
pub use widgets::Dropdown;
pub use widgets::Dropdown;
pub use widgets::FileDrop;
pub use widgets::FileDropTarget;
pub use widgets::FileDropTarget;
pub use widgets::Icon;
pub use widgets::Icon;
pub use widgets::Image;
pub use widgets::Image;
pub use widgets::KeyEvent;
pub use widgets::LazyColumn;
pub use widgets::LazyColumn;
pub use widgets::LazyGrid;
pub use widgets::LazyGrid;
pub use widgets::LazyRow;
pub use widgets::LazyRow;
pub use widgets::Menu;
pub use widgets::Menu;
pub use widgets::Navigation;
pub use widgets::Navigation;
pub use widgets::NavigationItem;
pub use widgets::NavigationItem;
pub use widgets::ProgressIndicator;
pub use widgets::ProgressIndicator;
pub use widgets::RadioButton;
pub use widgets::RadioButton;
pub use widgets::RangeRequest;
pub use widgets::Row;
pub use widgets::Row;
pub use widgets::Scaffold;
pub use widgets::Scaffold;
pub use widgets::ScrollColumn;
pub use widgets::ScrollColumn;
pub use widgets::SelectionContainer;
pub use widgets::SelectionContainer;
pub use widgets::Separator;
pub use widgets::Separator;
pub use widgets::Sheet;
pub use widgets::Sheet;
pub use widgets::Slider;
pub use widgets::Slider;
pub use widgets::Spacer;
pub use widgets::Spacer;
pub use widgets::Surface;
pub use widgets::Surface;
pub use widgets::Switch;
pub use widgets::Switch;
pub use widgets::Tabs;
pub use widgets::Tabs;
pub use widgets::Text;
pub use widgets::Text;
pub use widgets::TextField;
pub use widgets::TextField;
pub use widgets::TimePicker;
pub use widgets::TimePicker;
pub use widgets::Tooltip;
pub use widgets::Tooltip;
pub use widgets::TopAppBar;
pub use widgets::TopAppBar;
pub use window::NodeSize;
pub use window::WindowSize;
pub use window::node_size;
pub use window::use_node_size;
pub use window::use_window_size;
pub use window::window_size;
pub use elements::*;

Modules§

asset
Pictures: registering the bytes once and drawing them by id.
boundary
brush
Gradients and image fills: registered once, named by id wherever a colour can go.
design
Which design system the Renderer resolved the theme to, and the hook components read it through.
drawing
The closed drawing command set a Canvas node carries.
elements
events
message
Transient messages: the one sentence an application says after something happened.
prelude
protocol
Fixed-layout little-endian boundary protocol.
renderer
schema
Closed Rust-side schema and metadata used for Kotlin code generation.
spans
Runs of different treatment inside one Text.
tokens
Design token tables.
window
The window’s measured size, and the hook components read it through.

Macros§

android_main
Declares the Android entry point for an application’s cdylib.
ios_main
Declares the entry point an iOS application starts at.
rsx
The rsx! macro makes it easy for developers to write jsx-style markup in their components.
web_main
Declares the browser entry point for an application’s wasm module.

Structs§

FileDrop
The paths of the files a reader let go over a node.
KeyEvent
A key-down event whose consumption state is shared with the Host boundary.
RangeRequest
The visible item range the Renderer asks the Host to materialise.
VirtualDom
A virtual node system that progresses user events and diffs UI trees.

Functions§

Badge
A small mark on something else that says how many, that there is something new, or one short word.
Box
Props
Button
The variant is the seam the design system’s component rule attaches to. The same rsx draws differently per system, and that is correct behaviour.
Canvas
Pixels the widget vocabulary cannot produce: charts, sparklines, signature pads, rings.
Card
A grouped container. What a card looks like, its background, corner and resting elevation, is the design system’s decision, so the widget carries no appearance of its own. Modifier::Elevation overrides the resting height when the Host has a reason to.
Checkbox
A two-state box.
Column
Props
DatePicker
A date, as whole days since 1970-01-01.
Dialog
A modal. open seeds the Renderer’s own open state and carries changes that came from somewhere other than the Renderer; the Renderer runs the enter and exit itself so the animation never round trips through the Host. on_dismiss fires when the user asks to close it, and the Host decides whether to honour that by setting open to false.
Divider
A line between two things. The axis is the only decision the Host makes: the thickness, the colour and the inset all come from the design system.
Dropdown
One choice out of a list. Each child is one option, and the Renderer reports the position the user landed on.
FileDropTarget
A place files may be dropped.
Icon
A registered icon, tinted by a role. Host::register_icon registers the meaning rather than a picture, so the same declaration comes out as the icon each design system draws.
Image
A registered asset drawn as a picture. The bytes reached the Renderer once, through Host::register_asset, and what crosses per frame is the id.
LazyColumn
A windowed list. The Host declares item_count and a stable key per item, and materialises exactly the range the Renderer last requested.
LazyGrid
A grid that only builds the rows it can show.
LazyRow
The horizontal axis of the same windowing protocol LazyColumn uses, with the same contract: the Host materialises exactly the range the Renderer last asked for, and the read-ahead buffer belongs to the Renderer because the scroll position does.
LinearProgressIndicator
Material 3’s determinate linear progress indicator, as a worked extension example.
Menu
A popup anchored to anchor, which is the widget the menu hangs off. The anchor is the first child on the wire and the entries follow it, so the Renderer can place the popup without the Host knowing any screen coordinates.
Navigation
A set of destinations with one of them selected, plus the screen they lead to.
NavigationItem
One destination inside a Navigation.
ProgressIndicator
Work in progress. determinate says whether value means anything, and circular picks between the two forms every supported design system has.
RadioButton
One choice out of several. Which siblings it excludes is the Host’s business, so the widget carries only whether this one is the chosen one.
Row
Props
Scaffold
The screen’s frame: a top bar, a bottom bar, a floating action and the page.
ScrollColumn
The whole content with a vertical scroll attached. The scroll position is the Renderer’s, like focus and animation state, so scrolling never reaches the Host.
SelectionContainer
A region whose text can be dragged over and copied as one selection.
Separator
A hairline between two rows of a grouped list.
Sheet
A temporary surface that slides in from an edge, holding whatever its children are.
Slider
A value picked from a range.
Spacer
Props
Surface
A plain background-and-elevation container. Use it where a Card’s grouping meaning would be wrong and only the surface is wanted.
Switch
An on/off control. The same contract as Checkbox: the Host owns the value, and the track, the thumb and the way the change is animated belong to the design system.
Tabs
A row of tabs. Each child is one tab.
Text
type_role alone takes the design system’s size, weight, line height and letter spacing. Each override replaces one axis and costs one SetProp, so changing the font size does not resend the rest of the text’s styling.
TextField
Props
TimePicker
A time of day, as minutes since midnight.
Tooltip
An explanation attached to its child. It is a description as much as a hover popup: the Renderer also exposes the text to the accessibility tree, so a pointer is not the only way to reach it.
TopAppBar
The bar across the top of a screen. Its children are its content, left to right. How the bar is sized, spaced and separated from what is below it is the design system’s rule.

Type Aliases§

Element
An Element is a possibly-none VNode created by calling render on ScopeId or ScopeState.

Attribute Macros§

component
Component

Derive Macros§

Props
Props