Initial reorg.
This is largely the same as #305, but updated for the current tree.
This commit is contained in:
32
crates/wasi-common/src/fs/readdir.rs
Normal file
32
crates/wasi-common/src/fs/readdir.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use crate::fs::DirEntry;
|
||||
use crate::{hostcalls, wasi};
|
||||
|
||||
/// Iterator over the entries in a directory.
|
||||
///
|
||||
/// This corresponds to [`std::fs::ReadDir`].
|
||||
///
|
||||
/// TODO: Not yet implemented.
|
||||
///
|
||||
/// [`std::fs::ReadDir`]: https://doc.rust-lang.org/std/fs/struct.ReadDir.html
|
||||
pub struct ReadDir {
|
||||
fd: wasi::__wasi_fd_t,
|
||||
}
|
||||
|
||||
impl ReadDir {
|
||||
/// Constructs a new instance of `Self` from the given raw WASI file descriptor.
|
||||
pub unsafe fn from_raw_wasi_fd(fd: wasi::__wasi_fd_t) -> Self {
|
||||
Self { fd }
|
||||
}
|
||||
}
|
||||
|
||||
/// TODO: Not yet implemented.
|
||||
impl Iterator for ReadDir {
|
||||
type Item = DirEntry;
|
||||
|
||||
/// TODO: Not yet implemented.
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
unimplemented!("ReadDir::next");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: impl Debug for ReadDir
|
||||
Reference in New Issue
Block a user