mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
19 lines
437 B
Rust
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),
|
|
})
|
|
}
|
|
}
|