pub struct SyncReplica { /* private fields */ }Expand description
A deterministic logical device used by the native client and fault tests.
It intentionally models sync separately from filesystem watching. Native clients feed completed local writes into this module only after the local object store has captured and verified them.
Implementations§
Source§impl SyncReplica
impl SyncReplica
pub fn new(device_id: impl Into<String>) -> Self
pub fn write( &mut self, path: impl AsRef<Path>, bytes: impl Into<Vec<u8>>, kind: ContentKind, ) -> Result<()>
pub fn read(&self, path: impl AsRef<Path>) -> Option<&[u8]>
pub fn sync(&mut self, cloud: &mut MemorySyncCloud) -> Result<SyncReport>
Sourcepub fn apply_event(
&mut self,
cloud: &MemorySyncCloud,
event: &SyncEvent,
) -> Result<bool>
pub fn apply_event( &mut self, cloud: &MemorySyncCloud, event: &SyncEvent, ) -> Result<bool>
Apply a notification idempotently.
Dirty local content is never replaced; a normal sync will classify the divergence and preserve both sides.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncReplica
impl RefUnwindSafe for SyncReplica
impl Send for SyncReplica
impl Sync for SyncReplica
impl Unpin for SyncReplica
impl UnsafeUnpin for SyncReplica
impl UnwindSafe for SyncReplica
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