mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 00:31:35 +00:00
Derive some std::fmt::Debug
impls. (#1226)
* Derive some `Debug` impls. * And some more. Also remove several #[inline] attributes.
This commit is contained in:
@ -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<R> {
|
||||
/// 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<R> {
|
||||
inner: LengthDelimited<R>
|
||||
}
|
||||
|
@ -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<TInner> {
|
||||
state: State<TInner>
|
||||
}
|
||||
|
||||
/// A `Future` that waits on the completion of protocol negotiation.
|
||||
#[derive(Debug)]
|
||||
pub struct NegotiatedComplete<TInner> {
|
||||
inner: Option<Negotiated<TInner>>
|
||||
}
|
||||
@ -146,6 +148,7 @@ impl<TInner> Negotiated<TInner> {
|
||||
}
|
||||
|
||||
/// The states of a `Negotiated` I/O stream.
|
||||
#[derive(Debug)]
|
||||
enum State<R> {
|
||||
/// In this state, a `Negotiated` is still expecting to
|
||||
/// receive confirmation of the protocol it as settled on.
|
||||
|
@ -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<R> {
|
||||
inner: LengthDelimitedReader<R>
|
||||
}
|
||||
|
Reference in New Issue
Block a user