harlequinn/
lib.rs

1//! Harlequinn is a real-time networking library primarily aimed at games.
2//! It is based on the [Quinn](https://github.com/djc/quinn) implementation of the QUIC protocol.
3
4//! Harlequinn wraps around Quinn to provide an API that can be easily used from a synchronous game
5//! loop.
6//! It also implements some additional nice-to-have features out of the box.
7
8#![deny(bare_trait_objects)]
9#![warn(clippy::all)]
10
11mod endpoint;
12mod worker;
13
14pub use self::endpoint::{HqEndpoint, EndpointEvent};
15
16pub use quinn::{Certificate, PrivateKey};
17
18use slotmap::new_key_type;
19
20new_key_type! {
21    /// Represents a peer connected to an `HqEndpoint`.
22    pub struct PeerId;
23}
24
25#[derive(Debug, Copy, Clone, PartialEq)]
26pub enum MessageOrder {
27    Unordered,
28    Ordered,
29}