File tree Expand file tree Collapse file tree 3 files changed +94
-0
lines changed
postgres-protocol/src/replication Expand file tree Collapse file tree 3 files changed +94
-0
lines changed Original file line number Diff line number Diff line change
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
+
1
9
use std:: collections:: HashMap ;
2
10
3
11
use crate :: message:: backend:: Parse ;
4
12
13
+ /// Types related to the `pgoutput` plugin type
5
14
pub mod pgoutput;
15
+ /// Types related to the `raw` plugin type
6
16
pub mod raw;
7
17
8
18
pub use pgoutput:: PgOutput ;
9
19
pub use raw:: Raw ;
10
20
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`.
11
25
pub trait DecodingPlugin {
26
+ /// The type of messages contained into the logical stream
12
27
type Message : Parse ;
13
28
29
+ /// The name of the plugin
14
30
fn name ( & self ) -> & str ;
31
+ /// The options the plugin was initialized with
15
32
fn options ( & self ) -> HashMap < String , String > ;
16
33
}
You can’t perform that action at this time.
0 commit comments