feat(debug): add Debug impls for StatusClass, Server, and Listening
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
//! HTTP Server
|
||||
use std::fmt;
|
||||
use std::io::{ErrorKind, BufWriter, Write};
|
||||
use std::marker::PhantomData;
|
||||
use std::net::{SocketAddr, ToSocketAddrs};
|
||||
@@ -34,6 +35,7 @@ mod listener;
|
||||
///
|
||||
/// Once listening, it will create a `Request`/`Response` pair for each
|
||||
/// incoming connection, and hand them to the provided handler.
|
||||
#[derive(Debug)]
|
||||
pub struct Server<'a, H: Handler, L = HttpListener> {
|
||||
handler: H,
|
||||
ssl: Option<(&'a Path, &'a Path)>,
|
||||
@@ -187,6 +189,12 @@ pub struct Listening {
|
||||
pub socket: SocketAddr,
|
||||
}
|
||||
|
||||
impl fmt::Debug for Listening {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Listening {{ socket: {:?} }}", self.socket)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Listening {
|
||||
fn drop(&mut self) {
|
||||
let _ = self._guard.take().map(|g| g.join());
|
||||
|
||||
Reference in New Issue
Block a user