pub struct LeaseGuard { /* private fields */ }Expand description
Held by hand_over for as long as it runs; removes the lease on drop.
Implementations§
Source§impl LeaseGuard
impl LeaseGuard
Sourcepub fn enter(home: &Path, parked_run: Option<String>) -> Self
pub fn enter(home: &Path, parked_run: Option<String>) -> Self
Record that hand_over has been entered.
Sourcepub fn enter_parking(home: &Path) -> (Self, bool)
pub fn enter_parking(home: &Path) -> (Self, bool)
Enter the handover: write the lease and the parking stage as one step
under the progress lock, so a failing upgrade request (fail_progress)
or a fresh one (write_progress) cannot land between the two and leave
a record that is newer than the lease. None for the stage means
upgrade.json was unreadable (the lease is still written).
Trait Implementations§
Source§impl Debug for LeaseGuard
impl Debug for LeaseGuard
Source§impl Drop for LeaseGuard
impl Drop for LeaseGuard
Auto Trait Implementations§
impl Freeze for LeaseGuard
impl RefUnwindSafe for LeaseGuard
impl Send for LeaseGuard
impl Sync for LeaseGuard
impl Unpin for LeaseGuard
impl UnsafeUnpin for LeaseGuard
impl UnwindSafe for LeaseGuard
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