pub struct Lock { /* private fields */ }Expand description
An owner-scoped atomic cache lock.
Implementations§
Source§impl Lock
impl Lock
Sourcepub async fn block(&self, timeout: Duration) -> Result<(), Error>
pub async fn block(&self, timeout: Duration) -> Result<(), Error>
Wait up to timeout for this lock to become available.
Sourcepub async fn release(&self) -> Result<bool, Error>
pub async fn release(&self) -> Result<bool, Error>
Release this lock if its stored owner still matches.
Sourcepub async fn force_release(&self) -> Result<(), Error>
pub async fn force_release(&self) -> Result<(), Error>
Release the named lock regardless of its current owner.
Sourcepub async fn refresh(&self, seconds: Option<i64>) -> Result<bool, Error>
pub async fn refresh(&self, seconds: Option<i64>) -> Result<bool, Error>
Refresh the lock using another signed-second lifetime.
Zero or negative seconds make an owned lock indefinite.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Lock
impl !UnwindSafe for Lock
impl Forget for Lock
impl Freeze for Lock
impl Move 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