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_text as text;
43pub use umsh_ulcp as ulcp_wire;
44pub use umsh_uri as uri;
45
46#[cfg(feature = "tokio-support")]
47pub mod ulcp;
48
49#[cfg(feature = "embassy-support")]
50pub mod embassy_support;
51
52#[cfg(feature = "software-crypto")]
53pub mod test_vectors;
54
55#[cfg(feature = "tokio-support")]
56pub mod tokio_support;
57
58pub mod prelude {
59    //! Curated re-exports for the most common umbrella-crate entry points.
60    //!
61    //! This prelude intentionally favors the application-facing path:
62    //! `Host -> LocalNode -> PeerConnection -> payload wrapper`.
63    //!
64    //! Lower-level MAC coordinator types remain available from [`crate::mac`], but are not
65    //! pulled into the prelude by default.
66
67    pub use crate::Platform;
68
69    pub use umsh_core::{ChannelId, ChannelKey, PayloadType, PublicKey};
70    pub use umsh_mac::{LocalIdentityId, PacketFamily, RouteHops, SendOptions};
71    pub use umsh_node::{
72        ChannelInfoRef, CommandId, Host, HostError, LocalNode, MacCommand, NodeCapabilities,
73        NodeError, NodeIdentityPayload, NodeRole, OwnedMacCommand, PeerConnection,
74        ReceivedPacketRef, RxMetadata, SendProgressTicket, SendToken, Snr, Subscription, Transport,
75    };
76    pub use umsh_text::{
77        MessageSequence, MessageType, OwnedTextMessage, Regarding, TextMessage,
78        UnicastTextChatWrapper,
79    };
80
81    #[cfg(feature = "software-crypto")]
82    pub use umsh_node::{BoundChannel, Channel};
83
84    #[cfg(feature = "software-crypto")]
85    pub use umsh_text::MulticastTextChatWrapper;
86
87    #[cfg(feature = "software-crypto")]
88    pub use umsh_node::PfsStatus;
89}