pub struct Lock { /* private fields */ }Expand description
A named lock from Cache::lock.
Implementations§
Source§impl Lock
impl Lock
Sourcepub async fn try_acquire(&self) -> Result<Option<LockGuard>>
pub async fn try_acquire(&self) -> Result<Option<LockGuard>>
Takes the lock if it’s free.
Sourcepub async fn block(&self, wait: Duration) -> Result<LockGuard>
pub async fn block(&self, wait: Duration) -> Result<LockGuard>
Waits up to wait for the lock, then gives up with a 423 Locked
error.
Sourcepub async fn force_release(&self) -> Result
pub async fn force_release(&self) -> Result
Releases the lock whoever holds it (e.g. from an admin command).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Lock
impl !UnwindSafe for Lock
impl Freeze for Lock
impl Send for Lock
impl Sync for Lock
impl Unpin for Lock
impl UnsafeUnpin for Lock
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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