Skip to main content

Crate eye_declare

Crate eye_declare 

Source
Expand description

Inline terminal UIs: timeline-first, Elm-shaped, built on Ratatui.

Built on eye_declare_engine. Core commitments:

  • Committed output is an effect; the live tail is a view. Blocks are pushed once from update and flow into scrollback; only the small tail re-renders, every frame, with no dirty tracking.
  • Strict-Elm state: widget state lives in the app model as plain values; views borrow it.
  • Msg-free elements: elements describe structure and pixels only. All message emission happens in the keymap layer, so the element tree carries no message type parameter.
  • Honest measurement: Element::height(width) is required, exact, and cheap. No probe rendering.

For more information and examples, check out the eye-declare book.

Re-exports§

pub use app::App;
pub use app::Ctx;
pub use element::AnyElement;
pub use element::Element;
pub use element::ElementExt;
pub use element::Empty;
pub use element::Fluent;
pub use element::Padded;
pub use element::empty;
pub use focus::Focus;
pub use focus::FocusHandle;
pub use input::InputEvent;
pub use input::Key;
pub use input::Keymap;
pub use input::key;
pub use input::keymap;
pub use mailbox::Mailbox;
pub use markdown::Markdown;
pub use markdown::MarkdownStyles;
pub use markdown::markdown;
pub use panel::Panel;
pub use panel::panel;
pub use runtime::KeyboardProtocol;
pub use runtime::RunOptions;
pub use runtime::Runtime;
pub use runtime::ScreenMode;
pub use runtime::run;
pub use runtime::run_with;
pub use spinner::Spinner;
pub use spinner::spinner;
pub use stack::Col;
pub use stack::Row;
pub use stack::Width;
pub use stack::col;
pub use stack::row;
pub use subscription::Subscriptions;
pub use task::Effect;
pub use task::MsgStream;
pub use task::PersistTracker;
pub use task::Task;
pub use text::Text;
pub use text::text;
pub use text_area::TextArea;
pub use text_area::TextAreaState;
pub use text_area::text_area;
pub use timeline::Timeline;
pub use viewport::Viewport;
pub use viewport::viewport;

Modules§

app
The application contract: Elm-shaped, with the timeline as the effect boundary.
driver_tokio
The tokio driver: wraps Runtime in an async loop that multiplexes terminal events, messages from spawned work, and animation ticks.
element
The core Element trait and universal combinators.
focus
Focus as data (GPUI’s FocusHandle pattern).
input
Input events and the keymap: keys resolve to messages as data, rebuilt from the model each update so bindings can be conditional on app state.
mailbox
Exactly-once handoff to an async consumer that might never run.
markdown
CommonMark rendering via pulldown-cmark (feature markdown, on by default).
panel
Bordered chrome around a child element (the v1 View border/title surface, as a plain wrapper element).
runtime
The runtime: a headlessly-testable Runtime core plus the run terminal shell around it.
spinner
Animated spinner. Stateless by design: the frame index derives from the wall clock, because the runtime re-presents the tail continuously while any element reports animated. No effect system, no per-widget tick state — the v1 use_interval machinery has no v2 equivalent because nothing needs it.
stack
Layout containers: vertical Col and horizontal Row.
subscription
Declarative recurring inputs: message sources that exist because of what state the app is in.
task
Spawned work and its cancellation — and durability — story.
text
Word-wrapped styled text, the workhorse leaf element.
text_area
Editable multi-line text: state as a plain model value (strict Elm), view as a borrowing element.
timeline
The synchronous runtime core: a timeline of committed blocks plus a live tail, speaking Elements on one side and escape bytes on the other.
viewport
A fixed-height window over line-oriented output, pinned to the tail — the “live command output” widget (v1’s Viewport, as a plain element).

Enums§

CursorStyle
Hardware cursor shape, emitted as DECSCUSR (CSI n SP q).