1use fatfs::{DefaultTimeProvider, LossyOemCpConverter, ReadWriteSeek};
9
10pub trait Disk: ReadWriteSeek + Send {
11 fn is_present(&self) -> bool;
13}
14
15impl Disk for std::io::Cursor<Vec<u8>> {
17 fn is_present(&self) -> bool {
18 true
19 }
20}
21
22impl Disk for block_client::Cache {
23 fn is_present(&self) -> bool {
24 self.device().is_connected()
25 }
26}
27
28pub type FileSystem = fatfs::FileSystem<Box<dyn Disk>, DefaultTimeProvider, LossyOemCpConverter>;
29pub type Dir<'a> = fatfs::Dir<'a, Box<dyn Disk>, DefaultTimeProvider, LossyOemCpConverter>;
30pub type DirEntry<'a> =
31 fatfs::DirEntry<'a, Box<dyn Disk>, DefaultTimeProvider, LossyOemCpConverter>;
32pub type File<'a> = fatfs::File<'a, Box<dyn Disk>, DefaultTimeProvider, LossyOemCpConverter>;