pub struct CdcSubscriber { /* private fields */ }Expand description
A subscriber that tracks its position in the CDC log.
Implementations§
Source§impl CdcSubscriber
impl CdcSubscriber
Sourcepub fn new(log: Arc<CdcLog>, from_seq: u64) -> Self
pub fn new(log: Arc<CdcLog>, from_seq: u64) -> Self
Create a subscriber starting from the given sequence number.
Use 0 to start from the beginning of the buffer.
Sourcepub fn from_latest(log: Arc<CdcLog>) -> Self
pub fn from_latest(log: Arc<CdcLog>) -> Self
Create a subscriber starting from the current (latest) position.
Sourcepub fn with_tables(self, tables: Vec<String>) -> Self
pub fn with_tables(self, tables: Vec<String>) -> Self
Filter events to only include the given tables.
Sourcepub fn poll(&mut self, max_events: usize) -> CdcResult<Vec<CdcEvent>>
pub fn poll(&mut self, max_events: usize) -> CdcResult<Vec<CdcEvent>>
Poll for new events (non-blocking).
Auto Trait Implementations§
impl Freeze for CdcSubscriber
impl RefUnwindSafe for CdcSubscriber
impl Send for CdcSubscriber
impl Sync for CdcSubscriber
impl Unpin for CdcSubscriber
impl UnsafeUnpin for CdcSubscriber
impl UnwindSafe for CdcSubscriber
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more