@@ -55,6 +55,7 @@ pub struct ConnectParams {
55
55
}
56
56
57
57
/// Enum to specify p2p settings
58
+ #[ derive( Debug , PartialEq , Eq ) ]
58
59
pub enum P2P {
59
60
/// the node doesn't open a p2p port and work in standalone mode
60
61
No ,
@@ -79,19 +80,24 @@ const LOCAL_IP: Ipv4Addr = Ipv4Addr::new(127, 0, 0, 1);
79
80
80
81
/// The node configuration parameters, implements a convenient [Default] for most common use.
81
82
///
83
+ /// `#[non_exhaustive]` allows adding new parameters without breaking downstream users
84
+ ///
82
85
/// Default values:
83
- /// ```no_run
84
- /// bitcoind::Conf {
85
- /// args: vec!["-regtest", "-fallbackfee=0.0001"],
86
- /// view_stdout: false,
87
- /// p2p: bitcoind::P2P::No,
88
- /// network: "regtest",
89
- /// };
90
86
/// ```
87
+ /// let mut conf = bitcoind::Conf::default();
88
+ /// conf.args = vec!["-regtest", "-fallbackfee=0.0001"];
89
+ /// conf.view_stdout = false;
90
+ /// conf.p2p = bitcoind::P2P::No;
91
+ /// conf.network = "regtest";
92
+ /// assert_eq!(conf, bitcoind::Conf::default());
93
+ /// ```
94
+ ///
95
+ #[ non_exhaustive]
96
+ #[ derive( Debug , PartialEq , Eq ) ]
91
97
pub struct Conf < ' a > {
92
98
/// Bitcoind command line arguments containing no spaces like `vec!["-dbcache=300", "-regtest"]`
93
- /// note that `port`, `rpcport`, `connect`, `datadir`, `listen` cannot be used cause they are
94
- /// automatically initialized.
99
+ /// note that `port`, `rpcport`, `connect`, `datadir`, `listen`
100
+ /// cannot be used because they are automatically initialized.
95
101
pub args : Vec < & ' a str > ,
96
102
97
103
/// if `true` bitcoind log output will not be suppressed
0 commit comments