Add a simple UDP test

This commit is contained in:
Alex Crichton
2016-08-02 23:56:01 -07:00
parent c458e23940
commit 1d7098eece
3 changed files with 75 additions and 6 deletions
+13
View File
@@ -1,3 +1,4 @@
use std::fmt;
use std::io::{self, ErrorKind, Read, Write};
use std::mem;
use std::net::{self, SocketAddr, Shutdown};
@@ -127,6 +128,12 @@ impl Iterator for NonblockingIter {
}
}
impl fmt::Debug for TcpListener {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.listener.io().fmt(f)
}
}
impl Stream for TcpListener {
type Item = Ready;
type Error = io::Error;
@@ -335,6 +342,12 @@ impl<'a> Write for &'a TcpStream {
}
}
impl fmt::Debug for TcpStream {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.source.io().fmt(f)
}
}
impl Stream for TcpStream {
type Item = Ready;
type Error = io::Error;