pub struct ExecutorLockBuilder<L, T> { /* private fields */ }Expand description
Builder state after a lock has been attached.
Call Self::when to configure the required condition tester.
§Type Parameters
L- The lock type implementingLock<T>.T- The data type protected by the lock.
§Author
Haixing Hu
Implementations§
Source§impl<L, T> ExecutorLockBuilder<L, T>where
L: Lock<T>,
impl<L, T> ExecutorLockBuilder<L, T>where
L: Lock<T>,
Sourcepub fn log_unmet_condition(
self,
level: Level,
message: impl Into<String>,
) -> Self
pub fn log_unmet_condition( self, level: Level, message: impl Into<String>, ) -> Self
Configures logging when the double-checked condition is not met.
Sourcepub fn log_prepare_failure(
self,
level: Level,
message_prefix: impl Into<String>,
) -> Self
pub fn log_prepare_failure( self, level: Level, message_prefix: impl Into<String>, ) -> Self
Configures logging when the prepare action fails.
Sourcepub fn log_prepare_commit_failure(
self,
level: Level,
message_prefix: impl Into<String>,
) -> Self
pub fn log_prepare_commit_failure( self, level: Level, message_prefix: impl Into<String>, ) -> Self
Configures logging when the prepare commit action fails.
Sourcepub fn log_prepare_rollback_failure(
self,
level: Level,
message_prefix: impl Into<String>,
) -> Self
pub fn log_prepare_rollback_failure( self, level: Level, message_prefix: impl Into<String>, ) -> Self
Configures logging when the prepare rollback action fails.
Sourcepub fn when<Tst>(self, tester: Tst) -> ExecutorReadyBuilder<L, T>
pub fn when<Tst>(self, tester: Tst) -> ExecutorReadyBuilder<L, T>
Configures the required double-checked condition.
The tester is executed outside and inside the lock. State read by the outside check must be safe to access without this executor’s lock.
§Parameters
tester- The reusable condition tester.
§Returns
The builder state that can configure prepare callbacks and build the executor.
Trait Implementations§
Source§impl<L: Clone, T: Clone> Clone for ExecutorLockBuilder<L, T>
impl<L: Clone, T: Clone> Clone for ExecutorLockBuilder<L, T>
Source§fn clone(&self) -> ExecutorLockBuilder<L, T>
fn clone(&self) -> ExecutorLockBuilder<L, T>
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 moreAuto Trait Implementations§
impl<L, T> Freeze for ExecutorLockBuilder<L, T>where
L: Freeze,
impl<L, T> RefUnwindSafe for ExecutorLockBuilder<L, T>where
L: RefUnwindSafe,
impl<L, T> Send for ExecutorLockBuilder<L, T>where
L: Send,
impl<L, T> Sync for ExecutorLockBuilder<L, T>where
L: Sync,
impl<L, T> Unpin for ExecutorLockBuilder<L, T>where
L: Unpin,
impl<L, T> UnsafeUnpin for ExecutorLockBuilder<L, T>where
L: UnsafeUnpin,
impl<L, T> UnwindSafe for ExecutorLockBuilder<L, T>where
L: UnwindSafe,
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