pub struct ReplicationReceiver { /* private fields */ }Expand description
Replication receiver state machine.
Implementations§
Source§impl ReplicationReceiver
impl ReplicationReceiver
Sourcepub fn with_config(config: ReceiverConfig) -> Self
pub fn with_config(config: ReceiverConfig) -> Self
Create a new receiver with explicit configuration.
Sourcepub const fn state(&self) -> ReceiverState
pub const fn state(&self) -> ReceiverState
Current state.
Sourcepub const fn applied_count(&self) -> u64
pub const fn applied_count(&self) -> u64
Number of changesets successfully applied.
Sourcepub fn active_decoders(&self) -> usize
pub fn active_decoders(&self) -> usize
Number of active decoder sessions.
Sourcepub fn decode_audit_entries(&self) -> &[DecodeAuditEntry]
pub fn decode_audit_entries(&self) -> &[DecodeAuditEntry]
View decode-proof audit entries emitted so far.
Sourcepub fn take_decode_audit_entries(&mut self) -> Vec<DecodeAuditEntry>
pub fn take_decode_audit_entries(&mut self) -> Vec<DecodeAuditEntry>
Drain decode-proof audit entries.
Sourcepub fn process_packet(&mut self, packet_bytes: &[u8]) -> Result<PacketResult>
pub fn process_packet(&mut self, packet_bytes: &[u8]) -> Result<PacketResult>
Process a raw packet from the wire.
§Errors
Returns error if:
- Packet is malformed (too short, symbol_size = 0)
- V1 rule violated (SBN != 0)
- K_source out of range
- K_source or symbol_size mismatch for existing decoder
Sourcepub fn process_parsed_packet(
&mut self,
packet: &ReplicationPacket,
) -> Result<PacketResult>
pub fn process_parsed_packet( &mut self, packet: &ReplicationPacket, ) -> Result<PacketResult>
Sourcepub fn apply_pending(&mut self) -> Result<Vec<DecodeResult>>
pub fn apply_pending(&mut self) -> Result<Vec<DecodeResult>>
Apply pending decoded results. Returns applied page counts.
In production, this writes pages to the local database. Here we validate and return the results for the caller to apply.
§Errors
Returns error if not in APPLYING state.
Sourcepub fn reset_to_listening(&mut self) -> Result<()>
pub fn reset_to_listening(&mut self) -> Result<()>
Transition from COMPLETE back to LISTENING for the next changeset.
§Errors
Returns error if not in COMPLETE state.
Sourcepub fn force_reset(&mut self)
pub fn force_reset(&mut self)
Force reset to LISTENING from any state (e.g., on error recovery).
Trait Implementations§
Source§impl Debug for ReplicationReceiver
impl Debug for ReplicationReceiver
Auto Trait Implementations§
impl Freeze for ReplicationReceiver
impl RefUnwindSafe for ReplicationReceiver
impl Send for ReplicationReceiver
impl Sync for ReplicationReceiver
impl Unpin for ReplicationReceiver
impl UnsafeUnpin for ReplicationReceiver
impl UnwindSafe for ReplicationReceiver
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).