Skip to main content

secretspec_ipc/
lib.rs

1//! SecretSpec IPC version 1.
2//!
3//! The checked-in JSON schemas and protocol documents are canonical. This
4//! crate is an independent Rust implementation of their wire, client, server,
5//! resolution, and provider state machines.
6
7#[cfg(any(feature = "tokio", feature = "blocking"))]
8pub mod connection;
9pub mod deadline;
10pub mod error;
11pub mod frame;
12pub mod jsonrpc;
13pub mod launch;
14pub mod protocol;
15pub mod revision;
16
17#[cfg(feature = "tokio")]
18mod description;
19
20#[cfg(feature = "blocking")]
21pub mod blocking;
22
23#[cfg(feature = "tokio")]
24pub mod client;
25#[cfg(feature = "tokio")]
26pub mod lifecycle;
27#[cfg(feature = "tokio")]
28pub mod provider;
29#[cfg(feature = "tokio")]
30pub mod resolver;
31#[cfg(feature = "tokio")]
32pub mod server;
33
34pub use deadline::unix_ms_after as deadline_unix_ms_after;
35pub use error::{
36    Error, ErrorData, ErrorKind, InteractionKind, InteractionReference, Result, RpcError,
37};
38pub use jsonrpc::{Envelope, Notification, Request, RequestId, Response};
39pub use protocol::{Limits, Product};
40pub use revision::Revision;
41
42/// Wire protocol major version implemented by this crate.
43pub const WIRE_VERSION: u32 = 1;
44
45/// Absolute pre-negotiation and version 1 frame ceiling.
46pub const ABSOLUTE_MAX_FRAME_BYTES: usize = 1_048_576;
47
48/// Smallest negotiable frame limit.
49pub const MIN_FRAME_BYTES: usize = 4_096;
50
51/// Version 1 in-flight ceiling.
52pub const MAX_IN_FLIGHT: usize = 32;
53
54/// Largest request ID that is exactly representable by JSON/JavaScript peers.
55pub const MAX_REQUEST_ID: u64 = 9_007_199_254_740_991;