feat(wasi): provide default implementations for WasiFile (#3904)
Additionally, as cleanup, remove duplicate implementations.
This commit is contained in:
committed by
GitHub
parent
ae4d86804d
commit
44a435a43a
@@ -26,9 +26,6 @@ impl WasiFile for File {
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
async fn sock_accept(&mut self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
|
||||
Err(Error::badf())
|
||||
}
|
||||
async fn datasync(&self) -> Result<(), Error> {
|
||||
self.0.sync_data()?;
|
||||
Ok(())
|
||||
@@ -128,12 +125,6 @@ impl WasiFile for File {
|
||||
fn isatty(&self) -> bool {
|
||||
self.0.is_terminal()
|
||||
}
|
||||
async fn readable(&self) -> Result<(), Error> {
|
||||
Err(Error::badf())
|
||||
}
|
||||
async fn writable(&self) -> Result<(), Error> {
|
||||
Err(Error::badf())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn filetype_from(ft: &cap_std::fs::FileType) -> FileType {
|
||||
|
||||
Reference in New Issue
Block a user