add readable and writable futures to WasiFile trait

This commit is contained in:
Pat Hickey
2021-04-26 14:43:16 -07:00
parent fa44ec2da2
commit b307dce2ab
5 changed files with 39 additions and 0 deletions

View File

@@ -184,6 +184,12 @@ impl WasiFile for File {
use unsafe_io::AsUnsafeFile;
asyncify(|| self.0.as_file_view().num_ready_bytes()).await
}
async fn readable(&mut self) -> Result<(), Error> {
todo!("implement this in terms of tokio::io::AsyncFd")
}
async fn writable(&mut self) -> Result<(), Error> {
todo!("implement this in terms of tokio::io::AsyncFd")
}
}
pub fn filetype_from(ft: &cap_std::fs::FileType) -> FileType {
use cap_fs_ext::FileTypeExt;