}
pub type TimedFdReader = TimedFd<TimedFdRead>;
+pub type TimedFdWriter = TimedFd<TimedFdWrite>;
#[derive(Debug,Copy,Clone)] pub struct TimedFdRead;
impl TimedFdReadWrite for TimedFdRead {
const INTEREST : mio::Interest = mio::Interest::READABLE;
}
+#[derive(Debug,Copy,Clone)] pub struct TimedFdWrite;
+impl TimedFdReadWrite for TimedFdWrite {
+ const INTEREST : mio::Interest = mio::Interest::WRITABLE;
+}
pub struct Fd(RawFd);
impl Fd {
}
}
+impl Write for TimedFd<TimedFdWrite> {
+ #[throws(io::Error)]
+ fn write(&mut self, buf: &[u8]) -> usize {
+ self.rw(|fd| unistd::write(fd, buf))?
+ }
+ #[throws(io::Error)]
+ fn flush(&mut self) {
+ }
+}
+
impl Drop for Fd {
fn drop(&mut self) {
let fd = self.extract_raw_fd();