pub trait BinaryEntry: Sized {
// Required methods
fn entry_write(data_in: Self, buffer_out: &mut Vec<u8>) -> Result<()>;
fn entry_read(file: &mut File) -> Result<Self>;
fn entry_size() -> i64;
}Expand description
A single entry to be written to a binary file.
Required Methods§
Sourcefn entry_write(data_in: Self, buffer_out: &mut Vec<u8>) -> Result<()>
fn entry_write(data_in: Self, buffer_out: &mut Vec<u8>) -> Result<()>
Write an entry to a reusable output buffer.
Sourcefn entry_read(file: &mut File) -> Result<Self>
fn entry_read(file: &mut File) -> Result<Self>
Read an entry from a file.
Sourcefn entry_size() -> i64
fn entry_size() -> i64
Get the size of an entry.
Entries can vary in complexity, so it’s necessary to implement this rather than magically calculate it.
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.