mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
Remove deprecated code.
This commit removes code that was deprecated in tokio-core master.
This commit is contained in:
committed by
Alex Crichton
parent
36aaaa1520
commit
b23a997cb8
@@ -481,20 +481,6 @@ impl TcpStream {
|
||||
pub fn linger(&self) -> io::Result<Option<Duration>> {
|
||||
self.io.get_ref().linger()
|
||||
}
|
||||
|
||||
#[deprecated(since = "0.1.8", note = "use set_keepalive")]
|
||||
#[doc(hidden)]
|
||||
pub fn set_keepalive_ms(&self, keepalive: Option<u32>) -> io::Result<()> {
|
||||
#[allow(deprecated)]
|
||||
self.io.get_ref().set_keepalive_ms(keepalive)
|
||||
}
|
||||
|
||||
#[deprecated(since = "0.1.8", note = "use keepalive")]
|
||||
#[doc(hidden)]
|
||||
pub fn keepalive_ms(&self) -> io::Result<Option<u32>> {
|
||||
#[allow(deprecated)]
|
||||
self.io.get_ref().keepalive_ms()
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for TcpStream {
|
||||
@@ -532,46 +518,6 @@ impl AsyncWrite for TcpStream {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl ::io::Io for TcpStream {
|
||||
fn poll_read(&mut self) -> Async<()> {
|
||||
<TcpStream>::poll_read(self)
|
||||
}
|
||||
|
||||
fn poll_write(&mut self) -> Async<()> {
|
||||
<TcpStream>::poll_write(self)
|
||||
}
|
||||
|
||||
fn read_vec(&mut self, bufs: &mut [&mut IoVec]) -> io::Result<usize> {
|
||||
if let Async::NotReady = <TcpStream>::poll_read(self) {
|
||||
return Err(io::ErrorKind::WouldBlock.into())
|
||||
}
|
||||
let r = self.io.get_ref().read_bufs(bufs);
|
||||
if is_wouldblock(&r) {
|
||||
self.io.need_read();
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
fn write_vec(&mut self, bufs: &[&IoVec]) -> io::Result<usize> {
|
||||
if let Async::NotReady = <TcpStream>::poll_write(self) {
|
||||
return Err(io::ErrorKind::WouldBlock.into())
|
||||
}
|
||||
let r = self.io.get_ref().write_bufs(bufs);
|
||||
if is_wouldblock(&r) {
|
||||
self.io.need_write();
|
||||
}
|
||||
return r
|
||||
}
|
||||
}
|
||||
|
||||
fn is_wouldblock<T>(r: &io::Result<T>) -> bool {
|
||||
match *r {
|
||||
Ok(_) => false,
|
||||
Err(ref e) => e.kind() == io::ErrorKind::WouldBlock,
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Read for &'a TcpStream {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
(&self.io).read(buf)
|
||||
@@ -679,17 +625,6 @@ impl<'a> AsyncWrite for &'a TcpStream {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl<'a> ::io::Io for &'a TcpStream {
|
||||
fn poll_read(&mut self) -> Async<()> {
|
||||
<TcpStream>::poll_read(self)
|
||||
}
|
||||
|
||||
fn poll_write(&mut self) -> Async<()> {
|
||||
<TcpStream>::poll_write(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for TcpStream {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.io.get_ref().fmt(f)
|
||||
|
||||
Reference in New Issue
Block a user