use super::*;
use crate::{CStr16, Result, cstr16};
use alloc::boxed::Box;
pub const COMMON_SKIP_DIRS: &[&CStr16] = &[cstr16!("."), cstr16!("..")];
#[derive(Debug)]
pub struct UefiDirectoryIter(UefiDirectoryHandle);
impl UefiDirectoryIter {
#[must_use]
pub const fn new(handle: UefiDirectoryHandle) -> Self {
Self(handle)
}
}
impl Iterator for UefiDirectoryIter {
type Item = Result<Box<UefiFileInfo>, ()>;
fn next(&mut self) -> Option<Self::Item> {
let e = self.0.read_entry_boxed();
match e {
Ok(None) => None,
Ok(Some(e)) => Some(Ok(e)),
Err(e) => Some(Err(e)),
}
}
}