1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Wire protocol types for Arin.
//!
//! This crate is the public contract. It is pure types plus validation: no IO, no async
//! runtime, no platform code. It must build and test anywhere.
//!
//! # Shape
//!
//! JSON lines over a Unix domain socket, one object per line, UTF-8. Every message
//! carries a `v` field. The daemon accepts any minor version within its major and
//! ignores fields it does not know, so changes stay additive within a major version.
//!
//! ```
//! use arin_protocol::{ClientMessage, Envelope};
//!
//! let line = r#"{"v":"0.1","type":"point","x":412.0,"y":88.0,"display_id":1}"#;
//! let msg: Envelope<ClientMessage> = serde_json::from_str(line).unwrap();
//! assert!(msg.version.is_compatible_with(arin_protocol::PROTOCOL_VERSION));
//! ```
//!
//! # Coordinates
//!
//! Every coordinate is a logical point paired with an explicit display. Never physical
//! pixels. Physical conversion belongs inside platform crates and nowhere else.
pub use Anchor;
pub use ;
pub use ;
pub use Envelope;
pub use ;
pub use ;
pub use Position;
pub use ;
pub use ;
/// Compiles the README's examples as doctests.
///
/// The README is what someone reads on crates.io before they read anything else, so its
/// code is held to the same standard as the code in this file rather than being prose
/// that happens to be fenced.
;
/// Maximum accepted payload for a single line, in bytes.
///
/// Anything larger is rejected with [`ErrorCode::PayloadTooLarge`] rather than buffered.
pub const MAX_PAYLOAD_BYTES: usize = 1024 * 1024;