Skip to main content

rusty_esp_iroh_core/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![forbid(unsafe_code)]
3//! `rusty_esp_iroh-core` — the Janus mesh protocols, with no sockets in them.
4//!
5//! iroh itself runs on Track A only (`rusty_esp_iroh-esp`) and on hosts
6//! (`rusty_esp_iroh-host`). What every node, host, bridge and `no_std`
7//! neighbour must agree on lives here, testable on a laptop:
8//!
9//! | module | what |
10//! |---|---|
11//! | [`alpn`] | the ALPN strings and frame limits |
12//! | [`ticket`] | the QR / serial rendezvous ticket: endpoint id, DID, relay, addresses — `janus1…` text, no heap |
13//! | [`binding`] | the device key's signature over its iroh `EndpointId` — how a DID resolves to an endpoint |
14//! | [`assertion`] | the caller's mID assertion every RPC carries (the kms nonce-envelope shape) |
15//! | [`rpc`] | `janus/rpc/1`: postcard requests and responses with length-prefixed framing, and the authorisation rule |
16//! | [`media`] | `janus/media/1`: subscribe message and the packet header |
17//! | [`sidecar`] | `mata-oem-sidecar/rpc/1`: the home computer's existing JSON RPC and mDNS TXT contract, answered by a device |
18//!
19//! Rules (from the Janus mission plan): `no_std` by default; `alloc` is a
20//! feature; nothing here allocates on a per-packet path except the postcard
21//! codec, which is what `alloc` is for; every type that crosses to another
22//! Janus package comes from `rusty_esp_core` or `rusty_esp_mid-core`;
23//! `forbid(unsafe)`.
24
25#[cfg(feature = "alloc")]
26extern crate alloc;
27
28pub use rusty_esp_core as esp_core;
29pub use rusty_esp_mid_core as mid;
30
31pub mod alpn;
32pub mod assertion;
33pub mod base32;
34pub mod binding;
35pub mod ticket;
36
37#[cfg(feature = "alloc")]
38pub mod media;
39#[cfg(feature = "alloc")]
40pub mod ota;
41#[cfg(feature = "alloc")]
42pub mod rpc;
43#[cfg(feature = "alloc")]
44pub mod sidecar;
45
46pub use binding::Binding;
47pub use ticket::Ticket;
48
49/// The names a firmware or a host wants in scope.
50pub mod prelude {
51    pub use crate::alpn;
52    pub use crate::assertion::Assertion;
53    pub use crate::binding::Binding;
54    pub use crate::ticket::Ticket;
55    pub use rusty_esp_core::prelude::*;
56    pub use rusty_esp_mid_core::prelude::*;
57}
58
59/// Crate version, for capability manifests and logs.
60pub const VERSION: &str = env!("CARGO_PKG_VERSION");