diff --git a/tuic-quinn/README.md b/tuic-quinn/README.md index be51aa3..2f6bef6 100644 --- a/tuic-quinn/README.md +++ b/tuic-quinn/README.md @@ -8,7 +8,7 @@ A thin layer on top of [quinn](https://github.com/quinn-rs/quinn) to provide fun ## Overview -This crate provides a wrapper [`Connection`](https://docs.rs/tuic-quinn/latest/tuic-quinn/struct.Connection.html) around [`quinn::Connection`](https://docs.rs/quinn/latest/quinn/struct.Connection.html). It can be used to perform TUIC operations. +This crate provides a wrapper [`Connection`](https://docs.rs/tuic-quinn/latest/tuic_quinn/struct.Connection.html) around [`quinn::Connection`](https://docs.rs/quinn/latest/quinn/struct.Connection.html). It can be used to perform TUIC operations. Note that there is no TUIC protocol flow state machine abstraction in this crate. You need to implement it yourself. diff --git a/tuic-quinn/src/lib.rs b/tuic-quinn/src/lib.rs index 7762683..d3fab8b 100644 --- a/tuic-quinn/src/lib.rs +++ b/tuic-quinn/src/lib.rs @@ -40,7 +40,9 @@ pub mod side { } /// The TUIC Connection. +/// /// This struct takes a clone of `quinn::Connection` for performing TUIC operations. +/// /// See more details about the TUIC protocol at [SPEC.md](https://github.com/EAimTY/tuic/blob/dev/tuic/SPEC.md) #[derive(Clone)] pub struct Connection { @@ -161,6 +163,7 @@ impl Connection { } /// Try to parse a `quinn::RecvStream` as a TUIC command. + /// /// The `quinn::RecvStream` should be accepted by `quinn::Connection::accept_uni()` from the same `quinn::Connection`. pub async fn accept_uni_stream(&self, mut recv: RecvStream) -> Result { let header = match Header::async_unmarshal(&mut recv).await { @@ -186,6 +189,7 @@ impl Connection { } /// Try to parse a pair of `quinn::SendStream` and `quinn::RecvStream` as a TUIC command. + /// /// The pair of stream should be accepted by `quinn::Connection::accept_bi()` from the same `quinn::Connection`. pub async fn accept_bi_stream( &self, @@ -208,6 +212,7 @@ impl Connection { } /// Try to parse a QUIC Datagram as a TUIC command. + /// /// The Datagram should be accepted by `quinn::Connection::read_datagram()` from the same `quinn::Connection`. pub fn accept_datagram(&self, dg: Bytes) -> Result { let mut dg = Cursor::new(dg); @@ -255,6 +260,7 @@ impl Connection { } /// Try to parse a `quinn::RecvStream` as a TUIC command. + /// /// The `quinn::RecvStream` should be accepted by `quinn::Connection::accept_uni()` from the same `quinn::Connection`. pub async fn accept_uni_stream(&self, mut recv: RecvStream) -> Result { let header = match Header::async_unmarshal(&mut recv).await { @@ -285,6 +291,7 @@ impl Connection { } /// Try to parse a pair of `quinn::SendStream` and `quinn::RecvStream` as a TUIC command. + /// /// The pair of stream should be accepted by `quinn::Connection::accept_bi()` from the same `quinn::Connection`. pub async fn accept_bi_stream( &self, @@ -310,6 +317,7 @@ impl Connection { } /// Try to parse a QUIC Datagram as a TUIC command. + /// /// The Datagram should be accepted by `quinn::Connection::read_datagram()` from the same `quinn::Connection`. pub fn accept_datagram(&self, dg: Bytes) -> Result { let mut dg = Cursor::new(dg);