Struct tfio::Transaction[][src]

pub struct Transaction { /* fields omitted */ }

A rollbackable Transaction

Implementations

impl Transaction[src]

pub fn new() -> Self[src]

Constructs a new, empty Transaction

pub fn create_file<S: AsRef<Path>>(mut self: Self, path: S) -> Transaction[src]

Adds a CreateFile operation to the transaction

pub fn create_dir<S: AsRef<Path>>(mut self: Self, path: S) -> Transaction[src]

Adds a CreateDirectory operation to the transaction

pub fn append_file<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    temp_dir: S,
    data: Vec<u8>
) -> Transaction
[src]

Adds a AppendFile operation to the transaction

pub fn copy_file<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    dest: S
) -> Transaction
[src]

Adds a CopyFile operation to the transaction

pub fn copy_dir<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    dest: S,
    temp_dir: S
) -> Transaction
[src]

Adds a CopyDirectory operation to the transaction

pub fn delete_file<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    temp_dir: S
) -> Transaction
[src]

Adds a DeleteFile operation to the transaction

pub fn delete_dir<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    temp_dir: S
) -> Transaction
[src]

Adds a DeleteDirectory operation to the transaction

pub fn move_file<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    dest: S
) -> Transaction
[src]

Adds a MoveFile operation to the transaction

pub fn move_dir<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    dest: S
) -> Transaction
[src]

Adds a MoveDirectory operation to the transaction

pub fn write_file<S: AsRef<Path>>(
    mut self: Self,
    source: S,
    temp_dir: S,
    data: Vec<u8>
) -> Transaction
[src]

Adds a WriteFile operation to the transaction

Trait Implementations

impl RollbackableOperation for Transaction[src]

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

Executes the transaction

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

Performs rollback on the transaction

Only the operations that were executed will be rollbacked

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.