Skip to content

Commit 3c4ce7c

Browse files
committed
document all the logical replication types
Signed-off-by: Petros Angelatos <[email protected]>
1 parent 4d669f5 commit 3c4ce7c

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
1+
//! This module defines the [DecodingPlugin] trait that can be used to implement the decoding
2+
//! logic of any logical decoding plugin.
3+
//!
4+
//! Two reference implementations are provided:
5+
//!
6+
//! * [PgOutput]: Decodes the built-in pgoutput stream
7+
//! * [Raw]: A dummy plugin that yield each message it receives as bytes
8+
19
use std::collections::HashMap;
210

311
use crate::message::backend::Parse;
412

13+
/// Types related to the `pgoutput` plugin type
514
pub mod pgoutput;
15+
/// Types related to the `raw` plugin type
616
pub mod raw;
717

818
pub use pgoutput::PgOutput;
919
pub use raw::Raw;
1020

21+
/// A type that implements this trait can be used as a plugin during logical replication.
22+
///
23+
/// The majority of the work is implemented as part of the [Parse] implementation of the associated
24+
/// type `Message`.
1125
pub trait DecodingPlugin {
26+
/// The type of messages contained into the logical stream
1227
type Message: Parse;
1328

29+
/// The name of the plugin
1430
fn name(&self) -> &str;
31+
/// The options the plugin was initialized with
1532
fn options(&self) -> HashMap<String, String>;
1633
}

0 commit comments

Comments
 (0)