[−][src]Struct simplelock::LockBuilder
Builds a lock from a ConcreteLock implementation using the configurations enabled. See below for all possible configurations. Note, by implementing the ConcreteLock implementation you can wrap it with a LockBuilder to create the Lock interface used in all utility functions.
Implementations
impl LockBuilder
[src]
pub fn enable_silent_unlock(self)
[src]
If the unlock fails, intermediate computation may be lost. This may not be the behaviour you wished for, so enable silent_unlock. You can then check the lock status afterwards by performing Lock::status.
pub fn enable_try_lock(self)
[src]
If the lock is already taken, by default we would hang until it was our turn. By enabling 'try_lock' we instead try to lock but fail immediately with SimpleLockError::AlreadyLocked if we could not acquire it.
pub fn with_silent_unlock(self) -> Self
[src]
Performs enable_status_unlock
and then returns self so that we can chain
additional configurations or a call to build
.
pub fn with_try_lock(self) -> Self
[src]
Performs enable_try_lock
and then returns self so that we can chain
additional configurations or a call to build
.
pub fn wrap(
&self,
concrete: Box<dyn ConcreteLock>
) -> SimpleLockResult<Box<dyn Lock>>
[src]
&self,
concrete: Box<dyn ConcreteLock>
) -> SimpleLockResult<Box<dyn Lock>>
Wraps a ConcreteLock with the configurations enabled with this LockBuilder and returns the simplified Lock interface.
pub fn build(
&self,
app_name: impl Into<String>
) -> SimpleLockResult<Box<dyn Lock>>
[src]
&self,
app_name: impl Into<String>
) -> SimpleLockResult<Box<dyn Lock>>
Create a Lock based on the configurations enabled using the implementation enabled in the Cargo.toml. For example, if the "file" feature is enabled a FileLock will be produced from this build call.
Trait Implementations
impl Clone for LockBuilder
[src]
fn clone(&self) -> LockBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for LockBuilder
[src]
impl Debug for LockBuilder
[src]
impl Default for LockBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for LockBuilder
impl Send for LockBuilder
impl Sync for LockBuilder
impl Unpin for LockBuilder
impl UnwindSafe for LockBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,