pub struct SyncContext {
pub sync_id: SyncId,
pub target: SyncTarget,
pub state: SyncState,
/* private fields */
}Expand description
Everything a source is given for one run.
Fields§
§sync_id: SyncId§target: SyncTarget§state: SyncStateState from the previous run: validators, failure streak, timestamps.
Implementations§
Source§impl SyncContext
impl SyncContext
Sourcepub fn etag(&self) -> Option<&str>
pub fn etag(&self) -> Option<&str>
Validator from the last successful run, to be sent as If-None-Match.
Sourcepub fn last_modified(&self) -> Option<&str>
pub fn last_modified(&self) -> Option<&str>
Validator from the last successful run, to be sent as If-Modified-Since.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check between pages of a paginated fetch.
pub async fn cancelled(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncContext
impl RefUnwindSafe for SyncContext
impl Send for SyncContext
impl Sync for SyncContext
impl Unpin for SyncContext
impl UnsafeUnpin for SyncContext
impl UnwindSafe for SyncContext
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