1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use ParamMap;
use TextFmt;
/// Adapter trait for connector kinds (e.g., "mysql", "kafka").
/// This trait provides a unified interface without involving a registry.
///
/// # Examples
///
/// ```rust
/// use serde_json::json;
/// use wp_conf_base::connector::ConnectorKindAdapter;
/// use wp_connector_api::ParamMap;
///
/// struct MysqlAdapter;
///
/// impl ConnectorKindAdapter for MysqlAdapter {
/// fn kind(&self) -> &'static str {
/// "mysql"
/// }
///
/// fn defaults(&self) -> ParamMap {
/// let mut table = ParamMap::new();
/// table.insert("host".to_string(), json!("localhost"));
/// table.insert("port".to_string(), json!(3306));
/// table
/// }
/// }
/// ```