mirror of
https://github.com/htrefil/rkvm.git
synced 2024-11-17 07:47:45 +01:00
Implement AsRawFd for AsyncFile
This commit is contained in:
parent
82c01ecfe4
commit
97492ae8c8
1 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,7 @@ use mio::{Poll, PollOpt, Ready, Token};
|
|||
use std::convert::AsRef;
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::{Error, Read, Write};
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::os::unix::io::{AsRawFd, RawFd};
|
||||
use std::path::Path;
|
||||
use std::pin::Pin;
|
||||
use std::task::{self, Context};
|
||||
|
@ -31,6 +31,12 @@ impl AsyncFile {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRawFd for AsyncFile {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
self.file.get_ref().0.as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
||||
impl AsyncRead for AsyncFile {
|
||||
fn poll_read(
|
||||
mut self: Pin<&mut Self>,
|
||||
|
|
Loading…
Reference in a new issue