Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Commit

Permalink
Derive Debug for all types
Browse files Browse the repository at this point in the history
  • Loading branch information
pyfisch committed Jul 2, 2019
1 parent fd6c05f commit 0dfd509
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ where
}

/// A Serde `Deserialize`r of CBOR data.
#[derive(Debug)]
pub struct Deserializer<R> {
read: R,
remaining_depth: u8,
Expand Down Expand Up @@ -1215,6 +1216,7 @@ where
/// );
/// # }
/// ```
#[derive(Debug)]
pub struct StreamDeserializer<'de, R, T> {
de: Deserializer<R>,
output: PhantomData<T>,
Expand Down
5 changes: 5 additions & 0 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<R>
where
R: io::Read,
Expand Down Expand Up @@ -261,6 +262,7 @@ where
}

#[cfg(feature = "std")]
#[derive(Debug)]
struct OffsetReader<R> {
reader: R,
offset: u64,
Expand All @@ -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<u8>,
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ where
}

/// A structure for serializing Rust values to CBOR.
#[derive(Debug)]
pub struct Serializer<W> {
writer: W,
packed: bool,
Expand Down
3 changes: 3 additions & 0 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl<W> 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>(W);

#[cfg(feature = "std")]
Expand Down Expand Up @@ -103,6 +104,7 @@ impl Write for Vec<u8> {
impl private::Sealed for Vec<u8> {}

#[cfg(not(feature = "std"))]
#[derive(Debug)]
pub struct FmtWrite<'a, W: Write>(&'a mut W);

#[cfg(not(feature = "std"))]
Expand All @@ -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,
Expand Down

0 comments on commit 0dfd509

Please sign in to comment.