connection pooling

This commit is contained in:
Martin Algesten
2018-06-30 16:52:54 +02:00
parent c5fb12a1fe
commit 4a5944443f
8 changed files with 205 additions and 81 deletions

View File

@@ -22,6 +22,18 @@ pub enum Payload {
Reader(Box<Read + 'static>),
}
impl ::std::fmt::Debug for Payload {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::result::Result<(), ::std::fmt::Error> {
write!(f, "{}", match self {
Payload::Empty => "Empty",
Payload::Text(t, _) => &t,
#[cfg(feature = "json")]
Payload::JSON(_) => "JSON",
Payload::Reader(_) => "Reader",
})
}
}
impl Default for Payload {
fn default() -> Payload {
Payload::Empty