pub struct Subscription { /* private fields */ }Expand description
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn new(id: u64, pattern: Option<String>) -> Self
pub fn new(id: u64, pattern: Option<String>) -> Self
Create a subscription starting from sequence 0.
Sourcepub fn with_cursor(id: u64, pattern: Option<String>, cursor: u64) -> Self
pub fn with_cursor(id: u64, pattern: Option<String>, cursor: u64) -> Self
Create a subscription starting from the given sequence number.
Sourcepub fn cursor(&self) -> u64
pub fn cursor(&self) -> u64
Return the current read-cursor position (next sequence to consume).
Sourcepub fn poll(&mut self, ring: &CdcRing, limit: usize) -> CdcReadResult
pub fn poll(&mut self, ring: &CdcRing, limit: usize) -> CdcReadResult
Read up to limit new events from ring, advancing the cursor.
When a pattern is set, only events whose key matches the glob are included in the returned batch. The cursor still advances past non-matching events so they are not re-examined on the next poll.
Auto Trait Implementations§
impl Freeze for Subscription
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnsafeUnpin for Subscription
impl UnwindSafe for Subscription
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