pub struct SyncReceiverState { /* private fields */ }Expand description
In-memory receiver state for follower sync endpoint.
Implementations§
Source§impl SyncReceiverState
impl SyncReceiverState
Sourcepub fn new(
replication_log: Arc<Mutex<Box<dyn ReplicationLog + Send>>>,
checkpoint_store: Arc<dyn SyncCheckpointStore>,
) -> Self
pub fn new( replication_log: Arc<Mutex<Box<dyn ReplicationLog + Send>>>, checkpoint_store: Arc<dyn SyncCheckpointStore>, ) -> Self
Creates receiver state backed by a replication log and checkpoint store.
Sourcepub fn with_local_identity(self, local_identity: CoreIdentity) -> Self
pub fn with_local_identity(self, local_identity: CoreIdentity) -> Self
Configures the distributed identity used to validate v1 sync envelopes.
Sourcepub fn replication_log(&self) -> Arc<Mutex<Box<dyn ReplicationLog + Send>>> ⓘ
pub fn replication_log(&self) -> Arc<Mutex<Box<dyn ReplicationLog + Send>>> ⓘ
Returns a shared handle to the receiver’s replication log.
Sourcepub fn apply_sync_message(
&self,
message: &SyncMessage,
) -> SyncResult<SyncReceiveAck>
pub fn apply_sync_message( &self, message: &SyncMessage, ) -> SyncResult<SyncReceiveAck>
Validates and idempotently applies one already-authenticated batch.
Sourcepub fn apply_sync_envelope(
&self,
envelope: &SyncEnvelopeV1,
) -> SyncResult<SyncReceiveAck>
pub fn apply_sync_envelope( &self, envelope: &SyncEnvelopeV1, ) -> SyncResult<SyncReceiveAck>
Validates a decoded wire envelope before applying its replication batch.
Trait Implementations§
Source§impl Clone for SyncReceiverState
impl Clone for SyncReceiverState
Source§fn clone(&self) -> SyncReceiverState
fn clone(&self) -> SyncReceiverState
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for SyncReceiverState
impl !UnwindSafe for SyncReceiverState
impl Freeze for SyncReceiverState
impl Send for SyncReceiverState
impl Sync for SyncReceiverState
impl Unpin for SyncReceiverState
impl UnsafeUnpin for SyncReceiverState
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