diff --git a/core/src/upgrade/transfer.rs b/core/src/upgrade/transfer.rs index 019a6173..dd5aebcb 100644 --- a/core/src/upgrade/transfer.rs +++ b/core/src/upgrade/transfer.rs @@ -28,7 +28,6 @@ use tokio_io::{io, AsyncRead, AsyncWrite}; /// /// > **Note**: Prepends a variable-length prefix indicate the length of the message. This is /// > compatible with what `read_one` expects. -#[inline] pub fn write_one(socket: TSocket, data: TData) -> WriteOne where TSocket: AsyncWrite, @@ -50,10 +49,12 @@ fn build_int_buffer(num: usize) -> io::Window<[u8; 10]> { } /// Future that makes `write_one` work. +#[derive(Debug)] pub struct WriteOne> { inner: WriteOneInner, } +#[derive(Debug)] enum WriteOneInner { /// We need to write the data length to the socket. WriteLen(io::WriteAll>, TData), @@ -73,7 +74,6 @@ where type Item = (); type Error = std::io::Error; - #[inline] fn poll(&mut self) -> Poll { Ok(self.inner.poll()?.map(|_socket| ())) } @@ -125,7 +125,6 @@ where /// /// > **Note**: Assumes that a variable-length prefix indicates the length of the message. This is /// > compatible with what `write_one` does. -#[inline] pub fn read_one( socket: TSocket, max_size: usize, @@ -141,10 +140,12 @@ pub fn read_one( } /// Future that makes `read_one` work. +#[derive(Debug)] pub struct ReadOne { inner: ReadOneInner, } +#[derive(Debug)] enum ReadOneInner { // We need to read the data length from the socket. ReadLen { @@ -272,7 +273,6 @@ pub enum ReadOneError { } impl From for ReadOneError { - #[inline] fn from(err: std::io::Error) -> ReadOneError { ReadOneError::Io(err) } @@ -303,7 +303,6 @@ impl error::Error for ReadOneError { /// > ownership of any data we want. In practice, though, this would make the /// > `ReadRespond` type impossible to express as a concrete type. Once the `impl Trait` /// > syntax is allowed within traits, we can remove this parameter. -#[inline] pub fn read_one_then( socket: TSocket, max_size: usize, @@ -322,6 +321,7 @@ where } /// Future that makes `read_one_then` work. +#[derive(Debug)] pub struct ReadOneThen { inner: ReadOne, then: Option<(TParam, TThen)>, @@ -355,7 +355,6 @@ where /// > ownership of any data we want. In practice, though, this would make the /// > `ReadRespond` type impossible to express as a concrete type. Once the `impl Trait` /// > syntax is allowed within traits, we can remove this parameter. -#[inline] pub fn read_respond( socket: TSocket, max_size: usize, @@ -374,6 +373,7 @@ where } /// Future that makes `read_respond` work. +#[derive(Debug)] pub struct ReadRespond { inner: ReadOneInner, then: Option<(TThen, TParam)>, @@ -408,7 +408,6 @@ where /// > ownership of any data we want. In practice, though, this would make the /// > `ReadRespond` type impossible to express as a concrete type. Once the `impl Trait` /// > syntax is allowed within traits, we can remove this parameter. -#[inline] pub fn request_response( socket: TSocket, data: TData, @@ -427,10 +426,12 @@ where } /// Future that makes `request_response` work. +#[derive(Debug)] pub struct RequestResponse> { inner: RequestResponseInner, } +#[derive(Debug)] enum RequestResponseInner { // We need to write data to the socket. Write(WriteOneInner, usize, TParam, TThen), diff --git a/misc/multistream-select/src/length_delimited.rs b/misc/multistream-select/src/length_delimited.rs index 44dbfe95..5d22fb10 100644 --- a/misc/multistream-select/src/length_delimited.rs +++ b/misc/multistream-select/src/length_delimited.rs @@ -34,6 +34,7 @@ const DEFAULT_BUFFER_SIZE: usize = 64; /// We purposely only support a frame sizes up to 16KiB (2 bytes unsigned varint /// frame length). Frames mostly consist in a short protocol name, which is highly /// unlikely to be more than 16KiB long. +#[derive(Debug)] pub struct LengthDelimited { /// The inner I/O resource. inner: R, @@ -269,6 +270,7 @@ where /// A `LengthDelimitedReader` implements a `Stream` of uvi-length-delimited /// frames on an underlying I/O resource combined with direct `AsyncWrite` access. +#[derive(Debug)] pub struct LengthDelimitedReader { inner: LengthDelimited } diff --git a/misc/multistream-select/src/negotiated.rs b/misc/multistream-select/src/negotiated.rs index 9cc51fa7..afb9b867 100644 --- a/misc/multistream-select/src/negotiated.rs +++ b/misc/multistream-select/src/negotiated.rs @@ -36,11 +36,13 @@ use std::{mem, io, fmt, error::Error}; /// /// Reading from a `Negotiated` I/O stream that still has pending negotiation /// protocol data to send implicitly triggers flushing of all yet unsent data. +#[derive(Debug)] pub struct Negotiated { state: State } /// A `Future` that waits on the completion of protocol negotiation. +#[derive(Debug)] pub struct NegotiatedComplete { inner: Option> } @@ -146,6 +148,7 @@ impl Negotiated { } /// The states of a `Negotiated` I/O stream. +#[derive(Debug)] enum State { /// In this state, a `Negotiated` is still expecting to /// receive confirmation of the protocol it as settled on. diff --git a/misc/multistream-select/src/protocol.rs b/misc/multistream-select/src/protocol.rs index 4af91917..8e82ff18 100644 --- a/misc/multistream-select/src/protocol.rs +++ b/misc/multistream-select/src/protocol.rs @@ -297,6 +297,7 @@ where /// A `MessageReader` implements a `Stream` of `Message`s on an underlying /// I/O resource combined with direct `AsyncWrite` access. +#[derive(Debug)] pub struct MessageReader { inner: LengthDelimitedReader }