Implement Server Logging

This commit is contained in:
2019-05-24 17:23:12 +02:00
parent 6f9931a04f
commit c2bd135dd9
4 changed files with 126 additions and 25 deletions

View File

@ -1,5 +1,6 @@
use super::*;
use std::fmt;
use std::io::*;
use std::net::*;
@ -10,6 +11,14 @@ pub struct Connection<R: Read + Sized, W: Write + Sized> {
writer: W,
}
impl<R: Read + Sized, W: Write + Sized> fmt::Display for Connection<R, W> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "<Client>") // Todo use some form of marker??
}
}
impl<R: Read + Sized, W: Write + Sized> ClientConnection for Connection<R, W> {}
const KIB: u32 = 1024;
const MIB: u32 = 1024 * 1024;