pub struct PassiveReceiver { /* private fields */ }Expand description
Passive receiver that maintains shadow state
Implementations§
Source§impl PassiveReceiver
impl PassiveReceiver
Sourcepub fn new(
config: PassiveConfig,
initial_integrity: StateIntegrity,
initial_validators: HashMap<[u8; 48], ValidatorState>,
) -> (Self, PassiveHandle)
pub fn new( config: PassiveConfig, initial_integrity: StateIntegrity, initial_validators: HashMap<[u8; 48], ValidatorState>, ) -> (Self, PassiveHandle)
Create a new passive receiver
Sourcepub async fn run(self, shutdown_rx: Receiver<bool>) -> Result<(), PassiveError>
pub async fn run(self, shutdown_rx: Receiver<bool>) -> Result<(), PassiveError>
Run the passive receiver (connects and stays connected to primary)
Sourcepub fn replication_lag(&self) -> u64
pub fn replication_lag(&self) -> u64
Get current replication lag
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connected to primary
Auto Trait Implementations§
impl !Freeze for PassiveReceiver
impl !RefUnwindSafe for PassiveReceiver
impl Send for PassiveReceiver
impl Sync for PassiveReceiver
impl Unpin for PassiveReceiver
impl !UnwindSafe for PassiveReceiver
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