plushie_renderer_lib/lib.rs
1//! Shared renderer logic for plushie.
2//!
3//! This crate contains the platform-independent rendering engine that
4//! processes incoming messages, dispatches iced updates, and emits
5//! outgoing events. It compiles to both native and wasm32 targets.
6//!
7//! Platform-specific behavior (I/O, effects, sleep) is injected via
8//! traits and cfg-gated dependencies. The `plushie-renderer` binary
9//! and `plushie-renderer-wasm` WASM crate each provide their own
10//! implementations.
11
12/// Renderer crate version string.
13///
14/// Emitted by the renderer in the `hello` handshake message and
15/// cross-referenced by host SDKs (and `plushie::run_with_renderer`) to
16/// detect version skew between the SDK and an installed renderer
17/// binary. A mismatch is not fatal by itself (wire protocol
18/// compatibility is governed by `plushie_core::protocol::PROTOCOL_VERSION`),
19/// but host SDKs use this to surface a clear upgrade hint.
20pub const RENDERER_VERSION: &str = env!("CARGO_PKG_VERSION");
21
22pub mod app;
23pub mod apply;
24pub mod constants;
25pub mod emitter;
26pub mod emitters;
27pub mod events;
28pub mod execute;
29pub mod scripting;
30pub mod settings;
31pub mod subscriptions;
32pub mod update;
33pub mod view;
34pub mod widget_ops;
35pub mod window_map;
36pub mod window_ops;
37
38pub mod effects;
39
40/// The iced daemon application. See [`app::App`] for details.
41pub use app::App;
42
43/// Clamp or reject invalid scale factors. See [`app::validate_scale_factor`].
44pub use app::validate_scale_factor;
45
46/// Trait for platform-specific side effects. See [`effects::EffectHandler`].
47pub use effects::EffectHandler;
48
49/// Native (rfd + arboard + notify-rust) effect handler. See
50/// [`effects::native::NativeEffectHandler`].
51#[cfg(not(target_arch = "wasm32"))]
52pub use effects::NativeEffectHandler;
53
54/// Pluggable output for renderer events. See [`emitters::EventSink`].
55pub use emitters::EventSink;
56/// An EventSink that encodes via a codec and writes to a writer.
57pub use emitters::WriterSink;