polysig_protocol/
lib.rs

1//! Relay service protocol types, encoding and helper functions.
2//!
3//! # Size Limitations
4//!
5//! The maximum size of a [noise protocol](https://noiseprotocol.org/)
6//! message is 65535 and we further limit the size of buffers
7//! for encoding to 32KB.
8#![deny(missing_docs)]
9#![forbid(unsafe_code)]
10#![cfg_attr(all(doc, CHANNEL_NIGHTLY), feature(doc_auto_cfg))]
11#![allow(clippy::len_without_is_empty)]
12
13#[doc(hidden)]
14pub mod channel;
15mod constants;
16pub(crate) mod encoding;
17mod error;
18mod event;
19mod keypair;
20mod meetings;
21mod protocol;
22#[cfg(feature = "zlib")]
23pub mod zlib;
24
25pub use constants::*;
26pub use encoding::{decode, encode, VERSION};
27pub use error::Error;
28pub use event::{Event, JsonMessage};
29pub use keypair::*;
30pub use meetings::*;
31pub use protocol::*;
32
33pub use hex;
34pub use http;
35pub use log;
36pub use pem;
37pub use serde_json;
38pub use snow;
39pub use uuid;
40
41/// Round number.
42pub type RoundNumber = std::num::NonZeroU16;
43
44/// Party number.
45pub type PartyNumber = std::num::NonZeroU16;
46
47/// Result type for the protocol library.
48pub type Result<T> = std::result::Result<T, Error>;