pub struct SyncState {
pub last_attempt: Option<OffsetDateTime>,
pub last_success: Option<OffsetDateTime>,
pub last_outcome: Option<SyncOutcome>,
pub etag: Option<String>,
pub last_modified: Option<String>,
pub failure_streak: u32,
pub not_before: Option<OffsetDateTime>,
pub throttle_reason: Option<ThrottleReason>,
}Fields§
§last_attempt: Option<OffsetDateTime>§last_success: Option<OffsetDateTime>§last_outcome: Option<SyncOutcome>§etag: Option<String>Validators handed back to the service on the next request.
last_modified: Option<String>§failure_streak: u32Consecutive failures, used for exponential backoff.
not_before: Option<OffsetDateTime>A server-imposed floor on the next run: the next run may not start before this instant, whatever the policy cadence says. Surfaces a quota reset or a minimum poll interval and survives restart.
throttle_reason: Option<ThrottleReason>Why the target is throttled, if it is. For logs and the status view.
Implementations§
Source§impl SyncState
impl SyncState
pub fn record(&mut self, at: OffsetDateTime, outcome: SyncOutcome)
pub fn is_failing(&self) -> bool
Sourcepub fn throttle_until(&mut self, until: OffsetDateTime, reason: ThrottleReason)
pub fn throttle_until(&mut self, until: OffsetDateTime, reason: ThrottleReason)
Set a server-imposed floor on the next run.
Sourcepub fn clear_throttle(&mut self)
pub fn clear_throttle(&mut self)
Clear any server-imposed floor.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SyncState
impl<'de> Deserialize<'de> for SyncState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SyncState
impl RefUnwindSafe for SyncState
impl Send for SyncState
impl Sync for SyncState
impl Unpin for SyncState
impl UnsafeUnpin for SyncState
impl UnwindSafe 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
Mutably borrows from an owned value. Read more