pub struct SyncCursors {
pub sources: BTreeMap<String, i64>,
}Expand description
Per-source cursor state persisted at .kimetsu/sync-cursors.json.
Keys are machine_id strings; values are the last rowid imported from that machine. Our OWN machine_id is in here too (last exported rowid).
Fields§
§sources: BTreeMap<String, i64>map machine_id → last imported rowid (0 = never imported).
Implementations§
Source§impl SyncCursors
impl SyncCursors
pub fn load(path: &Path) -> KimetsuResult<Self>
pub fn save(&self, path: &Path) -> KimetsuResult<()>
pub fn cursor_for(&self, machine_id: &str) -> i64
pub fn set_cursor(&mut self, machine_id: &str, rowid: i64)
Trait Implementations§
Source§impl Clone for SyncCursors
impl Clone for SyncCursors
Source§fn clone(&self) -> SyncCursors
fn clone(&self) -> SyncCursors
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyncCursors
impl Debug for SyncCursors
Source§impl Default for SyncCursors
impl Default for SyncCursors
Source§fn default() -> SyncCursors
fn default() -> SyncCursors
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SyncCursors
impl<'de> Deserialize<'de> for SyncCursors
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 SyncCursors
impl RefUnwindSafe for SyncCursors
impl Send for SyncCursors
impl Sync for SyncCursors
impl Unpin for SyncCursors
impl UnsafeUnpin for SyncCursors
impl UnwindSafe for SyncCursors
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