yazi/yazi-vfs/src/provider/read_dir.rs
2025-11-18 13:56:20 +08:00

19 lines
437 B
Rust

use std::io;
use yazi_fs::provider::DirReader;
pub enum ReadDir {
Local(yazi_fs::provider::local::ReadDir),
Sftp(super::sftp::ReadDir),
}
impl DirReader for ReadDir {
type Entry = super::DirEntry;
async fn next(&mut self) -> io::Result<Option<Self::Entry>> {
Ok(match self {
Self::Local(reader) => reader.next().await?.map(Self::Entry::Local),
Self::Sftp(reader) => reader.next().await?.map(Self::Entry::Sftp),
})
}
}