pub trait SubscriptionCallback: Send + Sync {
// Required methods
fn on_entry(&self, vlsn: u64, entry_type: u8, data: &[u8]);
fn on_error(&self, error: &RepError);
fn on_caught_up(&self, vlsn: u64);
}Expand description
Callback for receiving replicated entries.
Implementations process each replicated entry as it arrives, handle errors, and are notified when the subscriber catches up to the master’s current position.
Required Methods§
Sourcefn on_entry(&self, vlsn: u64, entry_type: u8, data: &[u8])
fn on_entry(&self, vlsn: u64, entry_type: u8, data: &[u8])
Called when a new replicated entry is received.
§Arguments
vlsn- The VLSN of this entry.entry_type- The log entry type identifier.data- The raw entry payload.
Sourcefn on_error(&self, error: &RepError)
fn on_error(&self, error: &RepError)
Called when an error occurs during subscription processing.
Sourcefn on_caught_up(&self, vlsn: u64)
fn on_caught_up(&self, vlsn: u64)
Called when the subscription has caught up with the master.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".