pub trait BaseFile:
Send
+ Sync
+ 'static {
// Required methods
fn extension(&self) -> FileExtension;
fn allowed_extensions() -> &'static [FileExtension]
where Self: Sized;
fn read(&self, raw: &[u8]) -> Result<String, AppError>;
fn write(&self, content: &str) -> Result<Vec<u8>, AppError>;
}Required Methods§
fn extension(&self) -> FileExtension
fn allowed_extensions() -> &'static [FileExtension]where
Self: Sized,
fn read(&self, raw: &[u8]) -> Result<String, AppError>
fn write(&self, content: &str) -> Result<Vec<u8>, AppError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".