pub struct SyncEngine {
pub selected: Vec<SyncItem>,
/* private fields */
}Fields§
§selected: Vec<SyncItem>Implementations§
Source§impl SyncEngine
impl SyncEngine
pub fn new() -> Self
pub fn enable(&mut self, shared_secret: &str) -> Result<(), SyncError>
Sourcepub fn discover_peers(&self) -> Vec<PeerDevice>
pub fn discover_peers(&self) -> Vec<PeerDevice>
Stub — real impl would use mDNS
pub fn select_for_sync(&mut self, item: SyncItem)
pub fn is_selected(&self, item: &SyncItem) -> bool
pub fn sync(&self) -> Result<SyncResult, SyncError>
pub fn set_conflict_strategy(&mut self, strategy: ConflictStrategy)
pub fn get_conflict_strategy(&self) -> &ConflictStrategy
pub fn resolve_conflict( &mut self, key: &str, local_value: &[u8], local_ts: u64, remote_value: &[u8], remote_ts: u64, ) -> Vec<u8> ⓘ
pub fn queue_change(&mut self, key: &str, value: &[u8])
pub fn get_queued_count(&self) -> usize
pub fn flush_queue(&mut self) -> Vec<(String, Vec<u8>)>
pub fn conflict_log(&self) -> &[ConflictEntry]
pub fn encrypt(&self, data: &[u8]) -> Result<Vec<u8>, SyncError>
pub fn decrypt(&self, data: &[u8]) -> Result<Vec<u8>, SyncError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncEngine
impl RefUnwindSafe for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl UnsafeUnpin for SyncEngine
impl UnwindSafe for SyncEngine
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