pub struct Subscriptions { /* private fields */ }Implementations§
Source§impl Subscriptions
impl Subscriptions
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, name: &str) -> bool
pub fn get(&self, name: &str) -> Option<&Subscription>
pub fn iter(&self) -> impl Iterator<Item = (&String, &Subscription)>
pub fn create( &mut self, name: String, sub: Subscription, ) -> Result<(), SubscriptionError>
pub fn drop(&mut self, name: &str) -> bool
Sourcepub fn update_last_received_pos(&mut self, name: &str, pos: u64) -> bool
pub fn update_last_received_pos(&mut self, name: &str, pos: u64) -> bool
v6.1.4 — update the worker’s last-applied master-WAL offset. Called by the subscription worker after each apply batch. Returns false when the subscription was dropped between when the worker fetched the record and when this call landed (so the worker can shut down cleanly).
Sourcepub fn serialize(&self) -> Vec<u8>
pub fn serialize(&self) -> Vec<u8>
Format: [u16 num_subscriptions] for each: [u16 name_len][name bytes] [u32 conn_str_len][conn_str bytes] [u16 num_pubs] for each: [u16 p_len][p bytes] [u8 enabled] [u64 last_received_pos]
pub fn deserialize(buf: &[u8]) -> Result<Self, SubscriptionError>
Trait Implementations§
Source§impl Clone for Subscriptions
impl Clone for Subscriptions
Source§fn clone(&self) -> Subscriptions
fn clone(&self) -> Subscriptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Subscriptions
impl Debug for Subscriptions
Source§impl Default for Subscriptions
impl Default for Subscriptions
Source§fn default() -> Subscriptions
fn default() -> Subscriptions
Returns the “default value” for a type. Read more
impl Eq for Subscriptions
Source§impl PartialEq for Subscriptions
impl PartialEq for Subscriptions
Source§fn eq(&self, other: &Subscriptions) -> bool
fn eq(&self, other: &Subscriptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Subscriptions
Auto Trait Implementations§
impl Freeze for Subscriptions
impl RefUnwindSafe for Subscriptions
impl Send for Subscriptions
impl Sync for Subscriptions
impl Unpin for Subscriptions
impl UnsafeUnpin for Subscriptions
impl UnwindSafe for Subscriptions
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