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§
Sourcefn trim_exclusive_lock_left(&self, old_left: u64, new_left: u64) -> Result<bool>
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).
fn lock_segment( &self, arg: FlockArg, len: Option<u64>, offset: u64, ) -> Result<bool>
Provided Methods§
Sourcefn lock_max_segment(&self, arg: FlockArg) -> Result<bool>
fn lock_max_segment(&self, arg: FlockArg) -> Result<bool>
Locks a segment that spans the maximum possible range of offsets.