pub trait SaveFileHeader {
const VERSION: u32;
const USER_FILE_INFO_MAX: u32;
const FILE_SIZE_MAX: u32;
// Required methods
fn checksum(&self) -> Checksum;
fn version(&self) -> u32;
fn user_file_info_num(&self) -> u32;
fn file_size(&self) -> u32;
// Provided methods
fn check_be(&self, buf: &[u8]) -> Result<(), CheckSaveFileError> { ... }
fn check_le(&self, buf: &[u8]) -> Result<(), CheckSaveFileError> { ... }
fn check(&self, buf: &[u8]) -> Result<(), CheckSaveFileError> { ... }
}Expand description
A trait for standardizing save file header implementation.
Required Associated Constants§
Sourceconst USER_FILE_INFO_MAX: u32
const USER_FILE_INFO_MAX: u32
The maximum allowed number of user file descriptors.
Sourceconst FILE_SIZE_MAX: u32
const FILE_SIZE_MAX: u32
The maximum allowed size of the file, in bytes.
Required Methods§
Sourcefn user_file_info_num(&self) -> u32
fn user_file_info_num(&self) -> u32
Returns the number of stored user file descriptors.
Provided Methods§
Sourcefn check_be(&self, buf: &[u8]) -> Result<(), CheckSaveFileError>
fn check_be(&self, buf: &[u8]) -> Result<(), CheckSaveFileError>
Validates the save file header in big-endian.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".