summaryrefslogtreecommitdiff
path: root/spider/src/http_server.rs
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2021-02-14 18:33:29 +0400
committerAndrew <saintruler@gmail.com>2021-02-14 18:33:29 +0400
commit04a3c64713ae4f0a7f1b5cfdab132f78cc33a862 (patch)
tree012bd7b0a0352b48103a8a6b40dcaa919fbb2111 /spider/src/http_server.rs
parente59827e90c65f781cf054b52614308f538f7b018 (diff)
Renamed path field in Request struct to resource and implemented Display trait for HttpServer
Diffstat (limited to 'spider/src/http_server.rs')
-rw-r--r--spider/src/http_server.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/spider/src/http_server.rs b/spider/src/http_server.rs
index f12c45d..479ef3f 100644
--- a/spider/src/http_server.rs
+++ b/spider/src/http_server.rs
@@ -1,6 +1,7 @@
use std::net::{TcpListener, TcpStream, Shutdown};
use std::io::Write;
use std::str;
+use std::fmt;
use crate::request::Request;
use crate::response::Response;
@@ -125,3 +126,10 @@ impl<T> HttpServer<T> where T: HttpHandler {
};
}
}
+
+impl<T> fmt::Display for HttpServer<T> where T: HttpHandler {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ return write!(f, "HttpServer({}:{})", self.host, self.port);
+ }
+}
+