File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
postgres-protocol/src/replication Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ use std::collections::HashMap;
2
2
3
3
use crate :: message:: backend:: Parse ;
4
4
5
+ pub mod raw;
6
+
7
+ pub use raw:: Raw ;
8
+
5
9
pub trait DecodingPlugin {
6
10
type Message : Parse ;
7
11
Original file line number Diff line number Diff line change
1
+ use std:: collections:: HashMap ;
2
+
3
+ use bytes:: Bytes ;
4
+
5
+ use crate :: replication:: DecodingPlugin ;
6
+
7
+ pub struct Raw {
8
+ name : String ,
9
+ options : HashMap < String , String > ,
10
+ }
11
+
12
+ impl Raw {
13
+ pub fn new ( name : String , options : HashMap < String , String > ) -> Self {
14
+ Self { name, options }
15
+ }
16
+ }
17
+
18
+ impl DecodingPlugin for Raw {
19
+ type Message = Bytes ;
20
+
21
+ fn name ( & self ) -> & str {
22
+ & self . name
23
+ }
24
+
25
+ fn options ( & self ) -> HashMap < String , String > {
26
+ self . options . clone ( )
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments