1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Relay service protocol types, encoding and helper functions.
//!
//! # Size Limitations
//!
//! The maximum size of a [noise protocol](https://noiseprotocol.org/)
//! message is 65535 and we further limit the size of buffers
//! for encoding to 32KB.
#![deny(missing_docs)]
#![allow(clippy::len_without_is_empty)]

#[doc(hidden)]
pub mod channel;
mod constants;
pub(crate) mod encoding;
mod error;
mod keypair;
mod protocol;
#[cfg(feature = "zlib")]
pub mod zlib;

pub use constants::*;
pub use encoding::{decode, encode, VERSION};
pub use error::Error;
pub use keypair::*;
pub use protocol::*;

pub use hex;
pub use http;
pub use log;
pub use pem;
pub use snow;
pub use uuid;

/// Round number.
pub type RoundNumber = std::num::NonZeroU16;

/// Party number.
pub type PartyNumber = std::num::NonZeroU16;

/// Result type for the protocol library.
pub type Result<T> = std::result::Result<T, Error>;