pub enum ConnectionRetry {
Automatic,
AppAction {
version: u64,
failure: PassFailure,
},
AfterUpdate(PassFailure),
Never(PassFailure),
}Expand description
What permits this connection to attempt another pass. Time is held by
RetryWaits. A failure that waits for something other than time holds
every pass, and keeps what the status showed for it.
Variants§
Automatic
The persisted backoff and provider cooldown decide when to try.
AppAction
Only new credentials or a new connection can clear this failure.
Fields
failure: PassFailureWhat the status showed for it.
AfterUpdate(PassFailure)
Only reopening with an applicable update can retry the input.
Never(PassFailure)
This installation must be reset before it can retry.
Implementations§
Source§impl ConnectionRetry
impl ConnectionRetry
Sourcepub async fn open(database: &StoreDatabase) -> Result<Self, SyncError>
pub async fn open(database: &StoreDatabase) -> Result<Self, SyncError>
Reopening is a new connection, but cannot clear a permanent failure or recheck immutable input with the same software.
Sourcepub fn held(&self, waits: &RetryWaits) -> Option<&PassFailure>
pub fn held(&self, waits: &RetryWaits) -> Option<&PassFailure>
The failure holding every pass, if evidence does not permit an attempt; the caller also enforces its time wait.
Sourcepub async fn failed(
&mut self,
database: &StoreDatabase,
waits: &RetryWaits,
reason: PendingReason,
connection_version: u64,
error: SyncError,
shown: impl FnOnce(SyncError) -> PassFailure,
) -> Result<PassFailure, PassFailure>
pub async fn failed( &mut self, database: &StoreDatabase, waits: &RetryWaits, reason: PendingReason, connection_version: u64, error: SyncError, shown: impl FnOnce(SyncError) -> PassFailure, ) -> Result<PassFailure, PassFailure>
Save the failure and next deadline in one transaction before waiting,
and return what the status shows for it: shown turns the error into
that failure. If saving fails, the returned error is that failure
together with the save’s, and only new credentials or a new connection
retry it. The connection’s owner saves on its own, so a bug the save
fails on goes to the store’s bug sink (E15).
Sourcepub async fn succeeded(
&mut self,
database: &StoreDatabase,
waits: &RetryWaits,
) -> Result<(), SyncError>
pub async fn succeeded( &mut self, database: &StoreDatabase, waits: &RetryWaits, ) -> Result<(), SyncError>
A completed pass clears its condition and exponent together.
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionRetry
impl !UnwindSafe for ConnectionRetry
impl Freeze for ConnectionRetry
impl Send for ConnectionRetry
impl Sync for ConnectionRetry
impl Unpin for ConnectionRetry
impl UnsafeUnpin for ConnectionRetry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§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> ⓘ
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> ⓘ
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