pub enum SyncState {
Show 15 variants
NotSynced,
Syncing(SyncActivity),
WaitingToSync(SyncWait),
Synced,
Offline(SyncCause),
OfflineWithUnsentChanges(SyncCause),
SignedOut {
provider: CloudProvider,
cause: Option<SyncCause>,
},
NoAccess(SyncCause),
StorageFull(SyncCause),
FolderMissing(SyncCause),
ClockWrong(SyncCause),
UpdateNeeded(SyncCause),
Removed {
removal: Removal,
unsent: UnsentWork,
},
NeedsReset {
reason: ResetReason,
unsent: UnsentWork,
},
Failed(SyncCause),
}Expand description
The sync state (§19.1). With several candidates, the first of Removed,
NeedsReset, UpdateNeeded, SignedOut, NoAccess, FolderMissing,
ClockWrong, StorageFull, OfflineWithUnsentChanges, Offline,
Failed, Syncing, WaitingToSync, Synced shows; NotSynced comes
before them all. coven_sync_state.detail holds it as JSON, which this
type reads.
Variants§
NotSynced
No storage location is recorded on this device.
Syncing(SyncActivity)
Work that clears by itself is under way or next in line, with nothing holding it: what moves now, else a bound file, else a write, else the next pass.
WaitingToSync(SyncWait)
Nothing moves, and something holds the work for a while: the last pass was held back, at a slot that can’t apply yet or by a provider’s cooldown, or it or a bound file waits out a retry, or a write in the send queue waits for the pass: what the pass waits for, else what the first such file waits for, else what the write waits for.
Synced
The last pass reached the end of the sequence, every bound file this device uploads is stored, the send queue is empty, and nothing below holds: nothing waits. A trailing file never holds it.
Offline(SyncCause)
The last pass got no provider response.
OfflineWithUnsentChanges(SyncCause)
Offline, and the send queue holds a write or the upload queue a bound file with bytes to send.
SignedOut
A location is recorded, but this device holds no credentials for it (no cause), or storage refused them.
Fields
provider: CloudProviderThe recorded location’s provider.
NoAccess(SyncCause)
Signed in, but the account isn’t allowed.
StorageFull(SyncCause)
The provider’s quota is used up.
FolderMissing(SyncCause)
The storage folder or bucket is gone.
ClockWrong(SyncCause)
The device’s clock is too far from the provider’s.
UpdateNeeded(SyncCause)
A newer app or coven is needed.
Removed
This device isn’t in the store, and won’t be again. What was written here and not sent never will be.
Fields
unsent: UnsentWorkWhat this device committed and will not send.
NeedsReset
This installation can’t send under its keys or id. What was written here and not sent never will be.
Fields
reason: ResetReasonWhy it can’t send.
unsent: UnsentWorkWhat this device committed and will not send.
Failed(SyncCause)
Any other failure, or a bound file that can’t be uploaded or read, whose pending record is the cause.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SyncState
impl<'de> Deserialize<'de> for SyncState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SyncState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SyncState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl FromSql for SyncState
Reads coven_sync_state.detail.
impl FromSql for SyncState
Reads coven_sync_state.detail.
Source§fn column_result(value: ValueRef<'_>) -> Result<SyncState, FromSqlError>
fn column_result(value: ValueRef<'_>) -> Result<SyncState, FromSqlError>
Source§impl Serialize for SyncState
impl Serialize for SyncState
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 SyncState
Auto Trait Implementations§
impl !RefUnwindSafe for SyncState
impl !UnwindSafe for SyncState
impl Freeze for SyncState
impl Send for SyncState
impl Sync for SyncState
impl Unpin for SyncState
impl UnsafeUnpin for SyncState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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