hadris_core/
internal.rs

1use crate::{File, FileSystem, UtcTime};
2
3pub trait FileSystemRead: FileSystem {
4    /// This needs to be a mutable reference, because the filesystem might need to update metadata
5    /// of the file
6    fn read(&mut self, file: &File, buffer: &mut [u8], time: UtcTime) -> Result<usize, ()>;
7}
8
9pub trait FileSystemWrite: FileSystem {
10    fn write(&mut self, file: &File, buffer: &[u8], time: UtcTime) -> Result<usize, ()>;
11}
12
13pub trait FileSystemFull: FileSystem + FileSystemRead + FileSystemWrite {}
14
15impl<T: FileSystem + FileSystemRead + FileSystemWrite> FileSystemFull for T {}