pub struct SubscriptionManager { /* private fields */ }Expand description
Registry for multiple CDC subscriptions.
Assigns monotonically increasing IDs and provides lookup, creation, and
removal of Subscription instances.
Implementations§
Source§impl SubscriptionManager
impl SubscriptionManager
Sourcepub fn subscribe(&mut self, pattern: Option<String>) -> u64
pub fn subscribe(&mut self, pattern: Option<String>) -> u64
Create a subscription starting at sequence 0 and return its ID.
Sourcepub fn subscribe_at(&mut self, pattern: Option<String>, cursor: u64) -> u64
pub fn subscribe_at(&mut self, pattern: Option<String>, cursor: u64) -> u64
Create a subscription beginning at cursor and return its ID.
Sourcepub fn unsubscribe(&mut self, id: u64) -> bool
pub fn unsubscribe(&mut self, id: u64) -> bool
Remove a subscription by ID. Returns true if it existed.
Sourcepub fn get_mut(&mut self, id: u64) -> Option<&mut Subscription>
pub fn get_mut(&mut self, id: u64) -> Option<&mut Subscription>
Look up a subscription by ID, returning a mutable reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SubscriptionManager
impl RefUnwindSafe for SubscriptionManager
impl Send for SubscriptionManager
impl Sync for SubscriptionManager
impl Unpin for SubscriptionManager
impl UnsafeUnpin for SubscriptionManager
impl UnwindSafe for SubscriptionManager
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