umsh/lib.rs
1//! Umbrella crate that re-exports the UMSH workspace surface.
2//!
3//! In addition to re-exporting the core protocol crates, this crate defines the
4//! [`Platform`] trait and optional runtime adapters for Tokio and Embassy.
5//!
6//! For more details on the protocol, see the [UMSH protocol specification](https://darconeous.github.io/umsh/docs/protocol/).
7//!
8//! For other information about the project, see the [UMSH repository on GitHub](https://github.com/darconeous/umsh).
9//!
10//! > *Note*
11//! > This reference implementation is a work in progress and was developed with
12//! > the assistance of an LLM. It should be considered experimental.
13//!
14//! # Where to start
15//!
16//! Most applications should begin with:
17//!
18//! - [`node::Host`] to drive the shared MAC/runtime loop
19//! - [`node::LocalNode`] as the per-identity send surface
20//! - [`node::PeerConnection`] for peer-scoped interactions
21//! - payload-level wrappers such as [`text::UnicastTextChatWrapper`] when they want
22//! app-specific convenience on top of raw packet callbacks
23//!
24//! Lower layers remain available when you need them:
25//!
26//! - [`mac`] for packet- and radio-facing coordinator control
27//! - [`core`] for protocol types and packet parsing/building
28//! - [`crypto`] and [`hal`] for platform integrations
29//!
30//! The intended receive boundary is low-level: node callbacks work with
31//! [`node::ReceivedPacketRef`], and higher-level helpers live above that boundary rather than
32//! inside the node core.
33
34#[cfg(feature = "chat-rooms")]
35pub use umsh_chat_room as chat_room;
36pub use umsh_core as core;
37pub use umsh_crypto as crypto;
38pub use umsh_hal as hal;
39pub use umsh_mac as mac;
40pub use umsh_mac::Platform;
41pub use umsh_node as node;
42pub use umsh_node_mgmt as node_mgmt;
43pub use umsh_text as text;
44pub use umsh_ulcp as ulcp_wire;
45pub use umsh_uri as uri;
46
47#[cfg(feature = "tokio-support")]
48pub mod ulcp;
49
50#[cfg(feature = "tokio-support")]
51pub mod ulcp_mesh;
52
53#[cfg(feature = "embassy-support")]
54pub mod embassy_support;
55
56#[cfg(feature = "software-crypto")]
57pub mod test_vectors;
58
59#[cfg(feature = "tokio-support")]
60pub mod tokio_support;
61
62pub mod prelude {
63 //! Curated re-exports for the most common umbrella-crate entry points.
64 //!
65 //! This prelude intentionally favors the application-facing path:
66 //! `Host -> LocalNode -> PeerConnection -> payload wrapper`.
67 //!
68 //! Lower-level MAC coordinator types remain available from [`crate::mac`], but are not
69 //! pulled into the prelude by default.
70
71 pub use crate::Platform;
72
73 pub use umsh_core::{ChannelId, ChannelKey, PayloadType, PublicKey};
74 pub use umsh_mac::{LocalIdentityId, PacketFamily, RouteHops, SendOptions};
75 pub use umsh_node::{
76 ChannelInfoRef, CommandId, Host, HostError, LocalNode, MacCommand, NodeCapabilities,
77 NodeError, NodeIdentityPayload, NodeRole, OwnedMacCommand, PeerConnection,
78 ReceivedPacketRef, RxMetadata, SendProgressTicket, SendToken, Snr, Subscription, Transport,
79 };
80 pub use umsh_text::{
81 MessageSequence, MessageType, OwnedTextMessage, Regarding, TextMessage,
82 UnicastTextChatWrapper,
83 };
84
85 #[cfg(feature = "software-crypto")]
86 pub use umsh_node::{BoundChannel, Channel};
87
88 #[cfg(feature = "software-crypto")]
89 pub use umsh_text::MulticastTextChatWrapper;
90
91 #[cfg(feature = "software-crypto")]
92 pub use umsh_node::PfsStatus;
93}