pub trait FileDocumentwhere
Self: From<Self::FallbackDocType>,{
type FallbackDocType: StrictDecode;
const DOC_MAGIC: [u8; 4];
const FILE_EXT: &'static str;
// Provided methods
fn magic_u32() -> u32 { ... }
fn file_name(base: &str, order_no: usize) -> String { ... }
fn read_file(path: impl AsRef<Path>) -> Result<Self, Error>
where Self: StrictDecode { ... }
fn write_file(&self, path: impl AsRef<Path>) -> Result<usize, Error>
where Self: Sized + StrictEncode { ... }
}Required Associated Constants§
Required Associated Types§
Provided Methods§
fn magic_u32() -> u32
fn file_name(base: &str, order_no: usize) -> String
fn read_file(path: impl AsRef<Path>) -> Result<Self, Error>where
Self: StrictDecode,
fn write_file(&self, path: impl AsRef<Path>) -> Result<usize, Error>where
Self: Sized + StrictEncode,
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.