FileLocking

Trait FileLocking 

Source
pub trait FileLocking {
    // Required methods
    fn trim_exclusive_lock_left(
        &self,
        old_left: u64,
        new_left: u64,
    ) -> Result<bool>;
    fn lock_segment(
        &self,
        arg: FlockArg,
        len: Option<u64>,
        offset: u64,
    ) -> Result<bool>;

    // Provided method
    fn lock_max_segment(&self, arg: FlockArg) -> Result<bool> { ... }
}

Required Methods§

Source

fn trim_exclusive_lock_left(&self, old_left: u64, new_left: u64) -> Result<bool>

Returns Ok(false) if the lock could not be moved (you should assume the file is busted at this point).

Source

fn lock_segment( &self, arg: FlockArg, len: Option<u64>, offset: u64, ) -> Result<bool>

Provided Methods§

Source

fn lock_max_segment(&self, arg: FlockArg) -> Result<bool>

Locks a segment that spans the maximum possible range of offsets.

Implementations on Foreign Types§

Source§

impl FileLocking for File

Source§

fn trim_exclusive_lock_left(&self, old_left: u64, new_left: u64) -> Result<bool>

Source§

fn lock_segment( &self, arg: FlockArg, len: Option<u64>, offset: u64, ) -> Result<bool>

Implementors§