Skip to main content

BaseFile

Trait BaseFile 

Source
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§

Source

fn extension(&self) -> FileExtension

Source

fn allowed_extensions() -> &'static [FileExtension]
where Self: Sized,

Source

fn read(&self, raw: &[u8]) -> Result<String, AppError>

Source

fn write(&self, content: &str) -> Result<Vec<u8>, AppError>

Implementors§