pub struct MemoryLocker {
pub timeout: Duration,
/* private fields */
}Expand description
An in-memory locker using a simple spin-wait with small sleep intervals.
This locker is process-local; for multi-process deployments use a
distributed lock (e.g. Redis) or the file-based FileLocker.
Fields§
§timeout: DurationHow long to wait before giving up with LockTimeout.
Implementations§
Source§impl MemoryLocker
impl MemoryLocker
pub fn new() -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Trait Implementations§
Source§impl Clone for MemoryLocker
impl Clone for MemoryLocker
Source§fn clone(&self) -> MemoryLocker
fn clone(&self) -> MemoryLocker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemoryLocker
impl Default for MemoryLocker
Source§impl SendLocker for MemoryLocker
impl SendLocker for MemoryLocker
Auto Trait Implementations§
impl Freeze for MemoryLocker
impl !RefUnwindSafe for MemoryLocker
impl Send for MemoryLocker
impl Sync for MemoryLocker
impl Unpin for MemoryLocker
impl UnsafeUnpin for MemoryLocker
impl !UnwindSafe for MemoryLocker
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