pub trait FileFormatReader: Sized {
// Required methods
fn read_file(path: &Path) -> SisterResult<Self>;
fn can_read(path: &Path) -> SisterResult<FileInfo>;
fn file_version(path: &Path) -> SisterResult<Version>;
fn migrate(data: &[u8], from_version: Version) -> SisterResult<Vec<u8>>;
}Expand description
File format reader trait for all sisters.
Each sister implements this for its own file format. Memory reads .amem files, Vision reads .avis files, etc.
Required Methods§
Sourcefn read_file(path: &Path) -> SisterResult<Self>
fn read_file(path: &Path) -> SisterResult<Self>
Read a file with version handling
Sourcefn can_read(path: &Path) -> SisterResult<FileInfo>
fn can_read(path: &Path) -> SisterResult<FileInfo>
Check if a file is readable (without full parse). Returns file info for quick inspection
Sourcefn file_version(path: &Path) -> SisterResult<Version>
fn file_version(path: &Path) -> SisterResult<Version>
Get file version without full parse
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.