Trait tfio::SingleFileOperation[][src]

pub trait SingleFileOperation: RollbackableOperation + Drop {
    fn get_path(&self) -> &Path;
fn get_backup_path(&self) -> &Path;
fn set_backup_path<S: AsRef<Path>>(&mut self, uuid: S);
fn get_temp_dir(&self) -> &Path; fn dispose(&self) -> Result<()> { ... }
fn create_backup_file(&mut self) -> Result<()> { ... } }

Trait that represents a single file operation

Required methods

fn get_path(&self) -> &Path[src]

Returns path to source file

fn get_backup_path(&self) -> &Path[src]

Returns path to backup file

Defaults to ""

fn set_backup_path<S: AsRef<Path>>(&mut self, uuid: S)[src]

Sets the backup path

fn get_temp_dir(&self) -> &Path[src]

Returns path to temp dir

Loading content...

Provided methods

fn dispose(&self) -> Result<()>[src]

Dispose off resources used by the operation

It should be called inside Drop

fn create_backup_file(&mut self) -> Result<()>[src]

Creates a backup of the source file

If backup file is successfully created, method should call set_backup_path

Loading content...

Implementors

impl SingleFileOperation for AppendFile[src]

impl SingleFileOperation for DeleteFile[src]

impl SingleFileOperation for WriteFile[src]

Loading content...