pub enum LastPass {
Synced,
Offline {
failure: StorageFailure,
error: String,
},
Blocked {
slot: Slot,
reason: PendingReason,
error: Option<String>,
},
Failed {
failure: StatusFailure,
error: String,
},
}Expand description
How the last pass that reached storage, or failed trying, ended (E5), as
coven_sync_status.last_pass holds it. It outlives each connection:
opening keeps it, and the running loop writes it as each pass ends. An
error is kept as its text, which names every cause below it with secrets
and URLs already cut, so a pass read after the process that ran it ended
still says why.
Variants§
Synced
The pass reached its observed end; other subjects may still be pending.
Offline
The request preventing the pass received no usable provider response.
Fields
failure: StorageFailureThe network failure, as the provider adapter classified it.
Blocked
This slot invokes §5.4’s stuck-device rule.
Fields
reason: PendingReasonWhy it cannot apply.
Failed
Storage refused the whole pass, or coven’s own operation failed.
Implementations§
Source§impl LastPass
impl LastPass
Sourcepub fn failed(failure: impl Into<SyncFailure>) -> LastPass
pub fn failed(failure: impl Into<SyncFailure>) -> LastPass
How a pass that failed as a whole ended.
Sourcepub async fn record(&self, database: &Database) -> Result<(), DbError>
pub async fn record(&self, database: &Database) -> Result<(), DbError>
Write this as how the last pass ended when sync failed outside a
pass’s end: starting, stopping, or a local failure or panic of the
loop’s, in a pass or outside one; and that nothing moves, so the
state shows the failure (IO failed_worker_shows). A
failure fails the store’s handle with its cause
(DbError::StatePersistence), so the caller stops the work that
failed.
Sourcepub async fn record_halt(&self, database: &Database) -> Result<(), DbError>
pub async fn record_halt(&self, database: &Database) -> Result<(), DbError>
Write this, a store-wide worker’s panic, as how the last pass ended,
halting sync until the store reopens: nothing moves, and no pass
writes over it (IO halt). A failure fails the store’s handle, as
record’s does.
Sourcepub async fn record_end(
&self,
database: &Database,
now: SystemTime,
) -> Result<(), DbError>
pub async fn record_end( &self, database: &Database, now: SystemTime, ) -> Result<(), DbError>
Write this as how the running pass ended, now by the store’s clock,
and that it moves no more. A synced pass’s end becomes the last
synced time, unless that is later. A failure fails the store’s
handle, as record’s does.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LastPass
impl<'de> Deserialize<'de> for LastPass
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LastPass, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LastPass, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<PassFailure> for LastPass
impl From<PassFailure> for LastPass
Source§fn from(failure: PassFailure) -> LastPass
fn from(failure: PassFailure) -> LastPass
Source§impl FromSql for LastPass
Reads coven_sync_status.last_pass.
impl FromSql for LastPass
Reads coven_sync_status.last_pass.
Source§fn column_result(value: ValueRef<'_>) -> Result<LastPass, FromSqlError>
fn column_result(value: ValueRef<'_>) -> Result<LastPass, FromSqlError>
Source§impl Serialize for LastPass
impl Serialize for LastPass
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for LastPass
Auto Trait Implementations§
impl Freeze for LastPass
impl !RefUnwindSafe for LastPass
impl Send for LastPass
impl Sync for LastPass
impl Unpin for LastPass
impl UnsafeUnpin for LastPass
impl !UnwindSafe for LastPass
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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