pub struct WriterLock { /* private fields */ }Expand description
The process-lifetime advisory lock, plus the signal that it is gone.
Dropping this aborts the probe and closes the connection, which releases the lock — so scope IS lifetime, and there is no “forgot to unlock” path.
Implementations§
Source§impl WriterLock
impl WriterLock
Sourcepub async fn acquire(database_url: &SecretString) -> Result<Self>
pub async fn acquire(database_url: &SecretString) -> Result<Self>
Take the lock, or refuse. Never waits: another live kernel means this one must not start, and blocking would hide that behind a hang.
pub async fn acquire_with_interval( database_url: &SecretString, probe_interval: Duration, ) -> Result<Self>
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
True once write authority is gone. Callers stop accepting work.
Trait Implementations§
Source§impl Debug for WriterLock
impl Debug for WriterLock
Source§impl Drop for WriterLock
impl Drop for WriterLock
Auto Trait Implementations§
impl Freeze for WriterLock
impl RefUnwindSafe for WriterLock
impl Send for WriterLock
impl Sync for WriterLock
impl Unpin for WriterLock
impl UnsafeUnpin for WriterLock
impl UnwindSafe for WriterLock
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
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