pub struct ReplicationConnection {
pub server_version: Option<String>,
/* private fields */
}Fields§
§server_version: Option<String>Implementations§
Source§impl ReplicationConnection
impl ReplicationConnection
Sourcepub async fn connect(
info: &ConnectionInfo,
safety: &SafetyConfig,
timeout: Duration,
) -> Result<Self>
pub async fn connect( info: &ConnectionInfo, safety: &SafetyConfig, timeout: Duration, ) -> Result<Self>
Open a logical-replication connection to info.dbname.
Sourcepub fn set_max_message_bytes(&mut self, bytes: usize)
pub fn set_max_message_bytes(&mut self, bytes: usize)
Refuse backend messages larger than bytes (see resources.max_message_bytes).
Sourcepub async fn simple_query(&mut self, sql: &str) -> Result<SimpleResult>
pub async fn simple_query(&mut self, sql: &str) -> Result<SimpleResult>
Run a simple-query command (replication commands or SQL) and collect the result.
Sourcepub async fn start_replication(&mut self, command: &str) -> Result<()>
pub async fn start_replication(&mut self, command: &str) -> Result<()>
Issue START_REPLICATION ... and switch to CopyBoth mode.
Sourcepub async fn next_copy_data(&mut self) -> Result<Bytes>
pub async fn next_copy_data(&mut self) -> Result<Bytes>
Next CopyData payload from the server. Cancel-safe: a partially received frame stays buffered. Returns an error when the stream ends.
Sourcepub async fn send_copy_data(&mut self, payload: &[u8]) -> Result<()>
pub async fn send_copy_data(&mut self, payload: &[u8]) -> Result<()>
Send a CopyData frame (standby status update) to the server.
pub async fn close(self)
Auto Trait Implementations§
impl !RefUnwindSafe for ReplicationConnection
impl !Sync for ReplicationConnection
impl !UnwindSafe for ReplicationConnection
impl Freeze for ReplicationConnection
impl Send for ReplicationConnection
impl Unpin for ReplicationConnection
impl UnsafeUnpin for ReplicationConnection
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