pub struct UucpLock { /* private fields */ }Expand description
RAII handle for a UUCP lock file. Drops it when this value goes out of scope.
Implementations§
Source§impl UucpLock
impl UucpLock
Sourcepub fn acquire(device_path: &str) -> Result<Self>
pub fn acquire(device_path: &str) -> Result<Self>
Acquires a lock for device_path, trying /var/lock first and
falling back to /tmp on permission / not-found errors. On
non-Unix targets this is a no-op.
§Errors
Error::AlreadyLockedif a live process already owns the device.Error::Iofor filesystem failures the fallback cannot recover from.
Sourcepub fn acquire_in(device_path: &str, lock_dir: &Path) -> Result<Self>
pub fn acquire_in(device_path: &str, lock_dir: &Path) -> Result<Self>
Acquires a lock for device_path in the explicit lock_dir.
Tests use this entry to point the lock at a temporary directory
instead of the system-wide path. On non-Unix targets this is a
no-op.
§Errors
Same as UucpLock::acquire but without the /tmp fallback.
Sourcepub fn lock_file_path(&self) -> &Path
pub fn lock_file_path(&self) -> &Path
Returns the lock file path this guard owns.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UucpLock
impl RefUnwindSafe for UucpLock
impl Send for UucpLock
impl Sync for UucpLock
impl Unpin for UucpLock
impl UnsafeUnpin for UucpLock
impl UnwindSafe for UucpLock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more