pub trait FileGuardExt {
    // Required methods
    fn upgrade(&mut self) -> Result<()>;
    fn try_upgrade(&mut self) -> Result<()>;
}
Expand description

UNIX-specific extensions to FileGuard.

Required Methods§

source

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

Upgrades a lock from Shared to Exclusive.

If the currently held lock is already Exclusive, no change is made and the method succeeds.

source

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

Attempts to upgrade a lock from Shared to Exclusive.

If the currently held lock is already Exclusive, no change is made and the method succeeds. If the upgrade cannot be obtained without blocking, an Error of kind ErrorKind::WouldBlock is returned.

Implementors§

source§

impl<T> FileGuardExt for FileGuard<T>
where T: Deref<Target = File>,