pub struct Publications { /* private fields */ }Implementations§
Source§impl Publications
impl Publications
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, name: &str) -> bool
Sourcepub fn get(&self, name: &str) -> Option<&PublicationScope>
pub fn get(&self, name: &str) -> Option<&PublicationScope>
v6.1.3 — read a publication’s scope by name. Returns
None if no such publication; used by SHOW PUBLICATIONS
- the v6.1.5 publisher-side filter to resolve the per-record OWNER → publication membership question.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &PublicationScope)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &PublicationScope)>
Iterate (name, scope) in deterministic (alphabetical)
order. The order matters for snapshot byte-stability.
Sourcepub fn create(
&mut self,
name: String,
scope: PublicationScope,
) -> Result<(), PublicationError>
pub fn create( &mut self, name: String, scope: PublicationScope, ) -> Result<(), PublicationError>
PG-incompatible loud error on duplicate (PG silently does
nothing on IF NOT EXISTS; bare CREATE PUBLICATION on an
existing name DOES error in PG, so we match that).
Sourcepub fn drop(&mut self, name: &str) -> bool
pub fn drop(&mut self, name: &str) -> bool
Returns whether the publication was actually present. Callers can choose to surface the no-op or stay silent — the v6.1.2 PG-compat policy is silent (no-op), so the engine ignores this return.
Sourcepub fn serialize(&self) -> Vec<u8>
pub fn serialize(&self) -> Vec<u8>
Format: [u16 num_publications] for each: [u16 name_len][name bytes] [u8 scope_tag] 0 → AllTables (no trailer) 1 → ForTables / 2 → AllTablesExcept [u16 num_tables] for each: [u16 t_len][t bytes]
pub fn deserialize(buf: &[u8]) -> Result<Self, PublicationError>
Trait Implementations§
Source§impl Clone for Publications
impl Clone for Publications
Source§fn clone(&self) -> Publications
fn clone(&self) -> Publications
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Publications
impl Debug for Publications
Source§impl Default for Publications
impl Default for Publications
Source§fn default() -> Publications
fn default() -> Publications
impl Eq for Publications
Source§impl PartialEq for Publications
impl PartialEq for Publications
Source§fn eq(&self, other: &Publications) -> bool
fn eq(&self, other: &Publications) -> bool
self and other values to be equal, and is used by ==.