pub struct ReplicationStream { /* private fields */ }Expand description
Manages a replication stream
Implementations§
Source§impl ReplicationStream
impl ReplicationStream
Sourcepub fn new(log: Arc<ReplicationLog>, consumer_id: impl Into<String>) -> Self
pub fn new(log: Arc<ReplicationLog>, consumer_id: impl Into<String>) -> Self
Create a new replication stream
Sourcepub fn with_config(
log: Arc<ReplicationLog>,
consumer_id: impl Into<String>,
config: StreamConfig,
) -> Self
pub fn with_config( log: Arc<ReplicationLog>, consumer_id: impl Into<String>, config: StreamConfig, ) -> Self
Create with custom configuration
Sourcepub async fn stream_from(
&self,
start_sequence: u64,
) -> Result<Receiver<Vec<ChangeEvent>>>
pub async fn stream_from( &self, start_sequence: u64, ) -> Result<Receiver<Vec<ChangeEvent>>>
Start streaming from a given position
Sourcepub async fn resume(&self) -> Result<Receiver<Vec<ChangeEvent>>>
pub async fn resume(&self) -> Result<Receiver<Vec<ChangeEvent>>>
Resume streaming from the last checkpoint
Sourcepub fn get_checkpoint(&self) -> Option<Checkpoint>
pub fn get_checkpoint(&self) -> Option<Checkpoint>
Get the current checkpoint
Sourcepub fn set_checkpoint(&self, checkpoint: Checkpoint)
pub fn set_checkpoint(&self, checkpoint: Checkpoint)
Set a checkpoint manually
Sourcepub fn clear_checkpoint(&self)
pub fn clear_checkpoint(&self)
Clear the checkpoint
Auto Trait Implementations§
impl Freeze for ReplicationStream
impl !RefUnwindSafe for ReplicationStream
impl Send for ReplicationStream
impl Sync for ReplicationStream
impl Unpin for ReplicationStream
impl !UnwindSafe for ReplicationStream
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