pub trait FileEntryExt<R: Read + Seek> {
type FS: VirtualFSExt<R>;
// Required methods
fn file_reader(&self, fs: &mut Self::FS) -> Result<SubFile<R>, Error>;
fn file_size(&self) -> u64;
fn read_bytes(
&self,
fs: &mut Self::FS,
size: usize,
) -> Result<Vec<u8>, Error>;
fn file_name(&self) -> String;
// Provided method
fn file_extension(&self) -> Option<String> { ... }
}
Required Associated Types§
type FS: VirtualFSExt<R>
Required Methods§
Sourcefn file_reader(&self, fs: &mut Self::FS) -> Result<SubFile<R>, Error>
fn file_reader(&self, fs: &mut Self::FS) -> Result<SubFile<R>, Error>
Returns a virtual file reader that buffers and reads the file
This is useful for reading files from archives, which may be compressed or encrypted. And for reading large files, which may cause performance issues if the entire file is read into memory.
Provided Methods§
Sourcefn file_extension(&self) -> Option<String>
fn file_extension(&self) -> Option<String>
Get the file extension, if any.