]> git.lizzy.rs Git - connect-rs.git/blobdiff - src/lib.rs
refactor read/write for correctness and ordering of messages
[connect-rs.git] / src / lib.rs
index 033d389ad66c578eaf8973f478cbf931c73fb32f..522db960cb6c6c824d70deb6bb20c1813be194fb 100644 (file)
 mod protocol;
 mod reader;
 pub mod tcp;
+mod writer;
 
 #[cfg(feature = "tls")]
 #[doc(cfg(feature = "tls"))]
 pub mod tls;
 
-mod writer;
+use async_std::{net::SocketAddr, pin::Pin};
+use futures::{AsyncRead, AsyncWrite};
 
-pub use crate::protocol::{ConnectDatagram, DatagramEmptyError};
+pub use crate::protocol::{ConnectDatagram, DatagramError};
 pub use crate::reader::ConnectionReader;
 pub use crate::writer::{ConnectionWriteError, ConnectionWriter};
-use async_std::{net::SocketAddr, pin::Pin};
-use futures::{AsyncRead, AsyncWrite};
 pub use futures::{SinkExt, StreamExt};
 
 /// Wrapper around a [`ConnectionReader`] and [`ConnectionWriter`] to read and write on a network
@@ -98,3 +98,6 @@ impl Connection {
         return peer_addr;
     }
 }
+
+#[cfg(test)]
+mod tests {}