pub struct BookRecoveryState<E> { /* private fields */ }Expand description
Owns a book’s recovery episode under its adapter’s state lock.
Implementations§
Source§impl<E: Clone> BookRecoveryState<E>
impl<E: Clone> BookRecoveryState<E>
Sourcepub fn claim(&mut self) -> Option<Arc<BookRecovery<E>>>
pub fn claim(&mut self) -> Option<Arc<BookRecovery<E>>>
Claims one recovery episode, refusing while another is running.
Sourcepub fn current(&self) -> Option<&Arc<BookRecovery<E>>>
pub fn current(&self) -> Option<&Arc<BookRecovery<E>>>
Returns the current episode.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns whether a running episode owns the book.
Sourcepub fn reset_on_reconnect(&mut self)
pub fn reset_on_reconnect(&mut self)
Keeps a running episode, whose replacement may be in flight, and cancels any other so the next claim starts fresh.
The kept episode keeps its budget. The reconnect never interrupts an attempt or shortens a backoff inside the budget. An episode waiting between attempts after its budget attempts again at once; a reconnect during an attempt or before the budget runs out ends the next such wait instead.
Trait Implementations§
Source§impl<E: Debug> Debug for BookRecoveryState<E>
impl<E: Debug> Debug for BookRecoveryState<E>
Source§impl<E> Default for BookRecoveryState<E>
impl<E> Default for BookRecoveryState<E>
Source§impl<E> Drop for BookRecoveryState<E>
impl<E> Drop for BookRecoveryState<E>
Auto Trait Implementations§
impl<E> !RefUnwindSafe for BookRecoveryState<E>
impl<E> !UnwindSafe for BookRecoveryState<E>
impl<E> Freeze for BookRecoveryState<E>
impl<E> Send for BookRecoveryState<E>
impl<E> Sync for BookRecoveryState<E>
impl<E> Unpin for BookRecoveryState<E>
impl<E> UnsafeUnpin for BookRecoveryState<E>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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