Expand description
§Cotis
Cotis is the core of a modular and expandable Rust library for building native user interfaces.
The crate is intentionally split into small pieces that can be swapped or extended:
- layout interfaces and frame-building traits in
layout - renderer interfaces and drawing traits in
renders - conversion between layout output and renderer commands in
pipes - application orchestration in
cotis_app - element construction helpers in
element_configuring - optional launch hooks and utilities in
launchandutils
In other words, layout and renders define the integration traits
that concrete layout and renderer crates implement to plug into Cotis.
A frame is typically computed in this order:
- A layout manager prepares for a frame.
- UI code builds the element tree through the configurator API.
- The layout manager produces layout output items.
- A pipe transforms those items into renderer commands.
- A renderer draws the command stream.
§Quick start
The common entry point is cotis_app::CotisApp, which connects a layout manager,
renderer, and a pipes::LayoutRenderPipe. When layout output already matches
renderer commands, pass [()] as the identity pipe (see pipes).
ⓘ
use cotis::cotis_app::{CotisApp, RenderApp};
let mut app = CotisApp::new(renderer, manager, ());
app.compute_frame(|root| {
root.new_element().set_config(config);
});Use cotis_app::AsyncRenderApp when your renderer performs async drawing.
Modules§
- cotis_
app - Application orchestration and frame computation entry points.
- element_
configuring - Element configuration primitives framework used while building UI trees.
- launch
- Launch hooks for platform-controlled startup and
cotis-macrosentry attributes. Launch hooks for environments where the application entry point is not under the interface developer’s control. - layout
- Layout-side traits for frame construction, element configuration types, and layout output. Layout-side traits for building UI frames and producing per-frame output.
- pipes
- Pipes that transform layout output into renderer command streams. Conversion between layout output and renderer command streams.
- renders
- Renderer-side traits for synchronous and asynchronous frame drawing.
- utils
- Shared utility types (ownership wrappers, element identifiers, serialization helpers).