pub struct LockBuilder { /* private fields */ }Expand description
Represents the base builder for a TryLock instance.
Implementations§
Source§impl LockBuilder
impl LockBuilder
Sourcepub fn new(&self, lock_id: String) -> LockBuilderInstance
pub fn new(&self, lock_id: String) -> LockBuilderInstance
Returns a LockBuilderInstance with an ID to uniquely identify the lock.
Note: if 2 locks are assigned the same ID in a same policy, they will share the state. This behavior is extended to other policies when using the shared lock option.
Trait Implementations§
Source§impl FromContext<ConfigureContext> for LockBuilder
It can injected by the framework during the configuration phase of the policy lifecycle:
impl FromContext<ConfigureContext> for LockBuilder
It can injected by the framework during the configuration phase of the policy lifecycle:
#[entrypoint]
async fn configure(
launcher: Launcher,
Configuration(configuration): Configuration,
lock_builder: LockBuilder,
) -> Result<()> {
// your code here.
}type Error = Infallible
fn from_context(context: &ConfigureContext) -> Result<Self, Self::Error>
fn from_context_always(context: &C) -> Selfwhere
Self: FromContext<C, E, Error = Infallible>,
Auto Trait Implementations§
impl Freeze for LockBuilder
impl !RefUnwindSafe for LockBuilder
impl !Send for LockBuilder
impl !Sync for LockBuilder
impl Unpin for LockBuilder
impl UnsafeUnpin for LockBuilder
impl !UnwindSafe for LockBuilder
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