Skip to main content

whisker_engine/
lib.rs

1//! Host-independent retained scene engine for Whisker
2//!
3//! [`Scene`] owns logical nodes and their current presentation state. Mutations
4//! update that retained state and append to a coalescing change journal. At a
5//! frame boundary the scene prepares either a complete snapshot or an
6//! incremental [`whisker_protocol::FramePacket`], then advances its accepted revision only after
7//! the renderer confirms the complete transaction.
8//!
9//! [`SurfaceEngine`] pairs that scene with a retained Taffy layout tree. It
10//! keeps structural mutations synchronized, skips clean layout passes, and
11//! journals only geometry that changed from the previous snapshot.
12//!
13//! [`RecordingRenderer`] is the reference Rust-only consumer. Together with
14//! `whisker-protocol` it lets tree, revision, recovery, and incremental-update
15//! behavior run without Android, UIKit, DOM, FFI, or WASM.
16
17#![forbid(unsafe_code)]
18#![warn(missing_docs)]
19
20mod color;
21mod layout;
22mod measurement;
23mod paint;
24mod paragraph_visibility;
25mod radial_gradient;
26mod recording;
27mod scene;
28mod surface;
29mod text;
30
31pub use layout::{LayoutError, LayoutOptions, MeasurementProvider};
32pub use measurement::{
33    DeferredMeasurementApply, LayoutProgress, MeasurementApply, MeasurementError,
34};
35pub use paint::{LoweredPaint, lower_color, lower_paint, lower_transform};
36pub use recording::{FrameSink, RecordedFrame, RecordingRenderer};
37pub use scene::{Scene, SceneError, SceneNode};
38pub use surface::{LayoutUpdate, SurfaceEngine, SurfaceError, SurfacePresentError};
39pub use text::{
40    InlineAttachmentInput, LoweredPlainText, PlainTextInput, ResolvedTextRun, lower_plain_text,
41    lower_rich_text, lower_text_style,
42};
43pub use whisker_layout;
44pub use whisker_protocol;
45pub use whisker_style;