Skip to main content

icedwright_types/
lib.rs

1//! Types shared by every icedwright crate, including the featureless probe that apps link.
2//!
3//! - [`role`]: the runtime [`Role`] enum, one marker type per role, and the sealed capability
4//!   traits that gate role-specific methods at compile time.
5//! - [`geometry`] and [`units`]: points, vectors, sizes and rectangles, and the [`Logical`] and
6//!   [`Physical`] pixel newtypes with [`ScaleFactor`] between them.
7//! - [`time`]: [`VirtualInstant`] and [`VirtualDuration`], which never mix with the real clock.
8//! - [`frame`]: [`Frame`], an RGBA image at physical pixels.
9//! - [`input`]: key chords, their grammar and its parser.
10//! - [`messages`]: the [`Messages`] trait that `#[derive(Messages)]` implements.
11//! - [`state`]: [`StateName`], [`StateValue`], [`Checked`] and [`CursorSeen`], the node states
12//!   trees, YAML and selectors share.
13//!
14//! The `serde` feature derives serialisation for the types that cross the wire. The `iced`
15//! feature adds `From` conversions to and from `iced_core` types.
16
17#![forbid(unsafe_code)]
18#![deny(missing_docs)]
19#![warn(clippy::must_use_candidate, clippy::return_self_not_must_use)]
20
21pub mod frame;
22pub mod geometry;
23#[cfg(feature = "iced")]
24mod iced;
25pub mod input;
26pub mod messages;
27pub mod role;
28pub mod state;
29mod suggest;
30pub mod time;
31pub mod units;
32
33pub use frame::{Frame, FrameError};
34pub use geometry::{Point, Rect, Size, Vector};
35pub use input::{Chord, ChordError, Keystroke, ModifierSet};
36pub use messages::{Messages, VariantPath};
37pub use role::{ParseRoleError, Role, RoleMismatch};
38pub use state::{Checked, CursorSeen, ParseStateError, StateName, StateValue};
39pub use time::{VirtualDuration, VirtualInstant};
40pub use units::{InvalidRatio, InvalidScaleFactor, Logical, Physical, Ratio, ScaleFactor};