Skip to main content

nula_core/message/
mod.rs

1//! Wire messages exchanged over a relay WebSocket.
2//!
3//! Per [NIP-01], every Nostr message is a JSON array whose first element is
4//! the command name and whose subsequent elements depend on the command. This
5//! module models the two message families:
6//!
7//! - [`client::ClientMessage`] — sent from a client to a relay,
8//! - [`relay::RelayMessage`] — sent from a relay to a client.
9//!
10//! [`SubscriptionId`] is the opaque identifier shared by `REQ`, `EVENT`,
11//! `EOSE`, `CLOSE`, and `CLOSED` to correlate subscriptions.
12//!
13//! [NIP-01]: https://github.com/nostr-protocol/nips/blob/master/01.md
14
15pub mod client;
16pub mod relay;
17pub mod subscription_id;
18
19pub use self::client::{ClientMessage, ClientMessageError};
20pub use self::relay::{
21    MachineReadablePrefix, MachineReadablePrefixError, RelayMessage, RelayMessageError,
22};
23pub use self::subscription_id::{SubscriptionId, SubscriptionIdError};