Skip to main content

Crate hyprstream_compositor

Crate hyprstream_compositor 

Source
Expand description

hyprstream-compositor — pure Rust TUI compositor.

WASM-safe: no I/O, no ZMQ, no tokio, no libc. Compiles natively and to wasm32-wasip1.

§Usage (native CLI)

ⓘ
let mut compositor = Compositor::new(cols, rows, session_id, viewer_id, windows, models);

// In event loop:
let outputs = compositor.handle(CompositorInput::KeyPress(key));
for output in outputs {
    match output {
        CompositorOutput::Redraw => { terminal.draw(|f| compositor.render(f))?; }
        CompositorOutput::Rpc(req) => { rpc_adapter.dispatch(req, ...).await; }
        CompositorOutput::RouteInput { .. } => { /* Phase 4 */ }
        CompositorOutput::Quit => break,
    }
}

Re-exports§

pub use background::BackgroundState;
pub use background::BackgroundStyle;
pub use background::ALL_STYLES;
pub use background::PREVIEW_H;
pub use background::PREVIEW_W;
pub use chrome::is_local_id;
pub use chrome::keypress_to_bytes;
pub use chrome::ChromeOutput;
pub use chrome::ContainerEntry;
pub use chrome::ConversationKind;
pub use chrome::ConversationPickerEntry;
pub use chrome::GenerationDefaults;
pub use chrome::ImageEntry;
pub use chrome::InputDialog;
pub use chrome::InputField;
pub use chrome::ModelEntry;
pub use chrome::PaneSummary;
pub use chrome::PreChatSettingsState;
pub use chrome::PreChatType;
pub use chrome::RpcRequest;
pub use chrome::ServiceEntry;
pub use chrome::ServiceMode;
pub use chrome::ShellChrome;
pub use chrome::ShellMode;
pub use chrome::Toast;
pub use chrome::ToastLevel;
pub use chrome::WindowSummary;
pub use chrome::WorkerEntry;
pub use chrome::WorkerTab;
pub use chrome::LOCAL_ID_BIT;
pub use chrome::MENU_ITEMS;
pub use layout::CellUpdate;
pub use layout::CursorState;
pub use layout::FrameContent;
pub use layout::FrameUpdate;
pub use layout::LayoutTree;
pub use layout::PaneId;
pub use layout::PaneSource;
pub use layout::PaneState;
pub use layout::PaneStorage;
pub use layout::ScrollUpdate;

Modules§

background
Animated background styles for the empty-window state.
chrome
Shell chrome state machine — pure, no I/O, WASM-safe.
layout
Pane layout — per-pane buffer state.
render
Ratatui chrome rendering for the compositor.
theme
Color constants and reusable styles for hyprstream TUI applications.

Structs§

Compositor
The central compositor state machine.

Enums§

CompositorInput
Events delivered to the compositor from the event loop.
CompositorOutput
Actions returned by Compositor::handle.