pub struct InstanceLock { /* private fields */ }Expand description
Holds an exclusive OS-level lock on the save directory for the lifetime
of the process. std::fs::File::try_lock is stdlib (since Rust 1.89):
flock on Unix, LockFileEx on Windows.
Implementations§
Source§impl InstanceLock
impl InstanceLock
Sourcepub fn try_acquire() -> Result<Self>
pub fn try_acquire() -> Result<Self>
Acquire the lock or fail with io::ErrorKind::WouldBlock if another
instance holds it. Other IO failures (no save dir, permission denied)
surface their underlying error verbatim.
Auto Trait Implementations§
impl Freeze for InstanceLock
impl RefUnwindSafe for InstanceLock
impl Send for InstanceLock
impl Sync for InstanceLock
impl Unpin for InstanceLock
impl UnsafeUnpin for InstanceLock
impl UnwindSafe for InstanceLock
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more