diff --git a/src/de.rs b/src/de.rs index dcb9c5bd..56420f2f 100644 --- a/src/de.rs +++ b/src/de.rs @@ -123,6 +123,7 @@ where } /// A Serde `Deserialize`r of CBOR data. +#[derive(Debug)] pub struct Deserializer { read: R, remaining_depth: u8, @@ -1215,6 +1216,7 @@ where /// ); /// # } /// ``` +#[derive(Debug)] pub struct StreamDeserializer<'de, R, T> { de: Deserializer, output: PhantomData, diff --git a/src/read.rs b/src/read.rs index 3af9b3cb..89bbd7f0 100644 --- a/src/read.rs +++ b/src/read.rs @@ -133,6 +133,7 @@ mod private { /// CBOR input source that reads from a std::io input stream. #[cfg(feature = "std")] +#[derive(Debug)] pub struct IoRead where R: io::Read, @@ -261,6 +262,7 @@ where } #[cfg(feature = "std")] +#[derive(Debug)] struct OffsetReader { reader: R, offset: u64, @@ -283,6 +285,7 @@ where /// A CBOR input source that reads from a slice of bytes. #[cfg(feature = "std")] +#[derive(Debug)] pub struct SliceRead<'a> { slice: &'a [u8], scratch: Vec, @@ -391,6 +394,7 @@ impl<'a> Read<'a> for SliceRead<'a> { /// /// [`SliceRead`](struct.SliceRead.html) and [`MutSliceRead`](struct.MutSliceRead.html) are usually /// preferred over this, as they can handle indefinite length items. +#[derive(Debug)] pub struct SliceReadFixed<'a, 'b> { slice: &'a [u8], scratch: &'b mut [u8], @@ -497,6 +501,7 @@ impl<'a, 'b> Read<'a> for SliceReadFixed<'a, 'b> { /// A CBOR input source that reads from a slice of bytes, and can move data around internally to /// reassemble indefinite strings without the need of an allocated scratch buffer. +#[derive(Debug)] pub struct MutSliceRead<'a> { /// A complete view of the reader's data. It is promised that bytes before buffer_end are not /// mutated any more. diff --git a/src/ser.rs b/src/ser.rs index 031177c8..5d13f96b 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -44,6 +44,7 @@ where } /// A structure for serializing Rust values to CBOR. +#[derive(Debug)] pub struct Serializer { writer: W, packed: bool, diff --git a/src/write.rs b/src/write.rs index aa8d3dfc..53934017 100644 --- a/src/write.rs +++ b/src/write.rs @@ -67,6 +67,7 @@ impl private::Sealed for &mut W where W: Write {} /// A wrapper for types that implement /// [`std::io::Write`](https://doc.rust-lang.org/std/io/trait.Write.html) to implement the local /// [`Write`](trait.Write.html) trait. +#[derive(Debug)] pub struct IoWrite(W); #[cfg(feature = "std")] @@ -103,6 +104,7 @@ impl Write for Vec { impl private::Sealed for Vec {} #[cfg(not(feature = "std"))] +#[derive(Debug)] pub struct FmtWrite<'a, W: Write>(&'a mut W); #[cfg(not(feature = "std"))] @@ -126,6 +128,7 @@ impl<'a, W> private::Sealed for FmtWrite<'a, W> where W: Write {} /// Implements [`Write`](trait.Write.html) for mutable byte slices (`&mut [u8]`). /// /// Returns an error if the value to serialize is too large to fit in the slice. +#[derive(Debug)] pub struct SliceWrite<'a> { slice: &'a mut [u8], index: usize,