mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +02:00
Implement Debug for the various ByteBuf types
This commit is contained in:
committed by
Carl Lerche
parent
a76dd8ed0e
commit
01c1e05a91
+19
-1
@@ -1,6 +1,6 @@
|
||||
use {alloc, Bytes, SeqByteStr, MAX_CAPACITY};
|
||||
use traits::{Buf, MutBuf, MutBufExt, ByteStr};
|
||||
use std::{cmp, ptr};
|
||||
use std::{cmp, fmt, ptr};
|
||||
|
||||
/*
|
||||
*
|
||||
@@ -188,6 +188,12 @@ impl Buf for ByteBuf {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for ByteBuf {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.bytes().fmt(fmt)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* ===== ROByteBuf =====
|
||||
@@ -254,6 +260,12 @@ impl Buf for ROByteBuf {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for ROByteBuf {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.bytes().fmt(fmt)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* ===== MutByteBuf =====
|
||||
@@ -327,3 +339,9 @@ impl MutBuf for MutByteBuf {
|
||||
&mut self.buf.mem.bytes_mut()[pos..lim]
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for MutByteBuf {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.bytes().fmt(fmt)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user