pub mod drive;
pub mod duplex;
pub mod link;
pub mod node;
pub mod peer;
pub mod session;
pub mod stream;
pub mod table;
pub use drive::{establish, send_message};
pub use duplex::{DuplexFull, DuplexPort, DuplexWire, WireCopyError};
pub use link::{LinkError, LinkEvent, PeerLink};
pub use node::Node;
pub use peer::PeerId;
pub use session::{
Capabilities, HandshakeError, PeerSession, SessionConfig, SessionState, HELLO_LEN,
PROTOCOL_VERSION,
};
pub use stream::{
DefragError, Defragmenter, Fragmenter, HeaderError, MessageHeader, MessageId, StreamId,
HEADER_LEN,
};
pub use table::{PeerEntry, PeerTable, TableError, MAX_PEERS};
pub use DuplexWire as Wire;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn peer_session_stays_a_register_machine() {
let size = core::mem::size_of::<PeerSession>();
assert!(size <= 128, "PeerSession is {size} bytes — keep it tiny");
}
}