[][src]Trait tfio::SingleFileOperation

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

Trait that represents a single file operation

Required methods

fn get_path(&self) -> &String

Returns path to source file

fn get_backup_path(&self) -> &String

Returns path to backup file

Defaults to ""

fn set_backup_path<S: Into<String>>(&mut self, uuid: S)

Sets the backup path

fn get_temp_dir(&self) -> &String

Returns path to temp dir

Loading content...

Provided methods

fn dispose(&self) -> Result<()>

Dispose off resources used by the operation

It should be called inside Drop

fn create_backup_file(&mut self) -> Result<()>

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...