@@ -101,9 +101,9 @@ pub enum Host {
101
101
/// * `keepalives_idle` - The number of seconds of inactivity after which a keepalive message is sent to the server.
102
102
/// This option is ignored when connecting with Unix sockets. Defaults to 2 hours.
103
103
/// * `keepalives_interval` - The time interval between TCP keepalive probes.
104
- /// This option is ignored when connecting with Unix sockets. Available on neither Redox nor Solaris.
104
+ /// This option is ignored when connecting with Unix sockets.
105
105
/// * `keepalives_retries` - The maximum number of TCP keepalive probes that will be sent before dropping a connection.
106
- /// This option is ignored when connecting with Unix sockets. Available on neither Redox, Solaris nor Windows.
106
+ /// This option is ignored when connecting with Unix sockets.
107
107
/// * `target_session_attrs` - Specifies requirements of the session. If set to `read-write`, the client will check that
108
108
/// the `transaction_read_write` session parameter is set to `on`. This can be used to connect to the primary server
109
109
/// in a database cluster as opposed to the secondary read-only mirrors. Defaults to `all`.
@@ -177,9 +177,7 @@ impl Config {
177
177
pub fn new ( ) -> Config {
178
178
let keepalive_config = KeepaliveConfig {
179
179
idle : Duration :: from_secs ( 2 * 60 * 60 ) ,
180
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" ) ) ) ]
181
180
interval : None ,
182
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
183
181
retries : None ,
184
182
} ;
185
183
Config {
@@ -373,37 +371,25 @@ impl Config {
373
371
/// On Windows, this sets the value of the tcp_keepalive struct’s keepaliveinterval field.
374
372
///
375
373
/// This is ignored for Unix domain sockets, or if the `keepalives` option is disabled.
376
- ///
377
- /// Available on neither Redox nor Solaris.
378
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" ) ) ) ]
379
374
pub fn keepalives_interval ( & mut self , keepalives_interval : Duration ) -> & mut Config {
380
375
self . keepalive_config . interval = Some ( keepalives_interval) ;
381
376
self
382
377
}
383
378
384
379
/// Gets the time interval between TCP keepalive probes.
385
- ///
386
- /// Available on neither Redox nor Solaris.
387
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" ) ) ) ]
388
380
pub fn get_keepalives_interval ( & self ) -> Option < & Duration > {
389
381
self . keepalive_config . interval . as_ref ( )
390
382
}
391
383
392
384
/// Sets the maximum number of TCP keepalive probes that will be sent before dropping a connection.
393
385
///
394
386
/// This is ignored for Unix domain sockets, or if the `keepalives` option is disabled.
395
- ///
396
- /// Available on neither Redox, Solaris nor Windows.
397
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
398
387
pub fn keepalives_retries ( & mut self , keepalives_retries : u32 ) -> & mut Config {
399
388
self . keepalive_config . retries = Some ( keepalives_retries) ;
400
389
self
401
390
}
402
391
403
392
/// Gets the maximum number of TCP keepalive probes that will be sent before dropping a connection.
404
- ///
405
- /// Available on neither Redox, Solaris nor Windows.
406
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
407
393
pub fn get_keepalives_retries ( & self ) -> Option < & u32 > {
408
394
self . keepalive_config . retries . as_ref ( )
409
395
}
@@ -502,7 +488,6 @@ impl Config {
502
488
self . keepalives_idle ( Duration :: from_secs ( keepalives_idle as u64 ) ) ;
503
489
}
504
490
}
505
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" ) ) ) ]
506
491
"keepalives_interval" => {
507
492
let keepalives_interval = value. parse :: < i64 > ( ) . map_err ( |_| {
508
493
Error :: config_parse ( Box :: new ( InvalidValue ( "keepalives_interval" ) ) )
@@ -511,7 +496,6 @@ impl Config {
511
496
self . keepalives_interval ( Duration :: from_secs ( keepalives_interval as u64 ) ) ;
512
497
}
513
498
}
514
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
515
499
"keepalives_retries" => {
516
500
let keepalives_retries = value. parse :: < u32 > ( ) . map_err ( |_| {
517
501
Error :: config_parse ( Box :: new ( InvalidValue ( "keepalives_retries" ) ) )
@@ -601,8 +585,8 @@ impl fmt::Debug for Config {
601
585
}
602
586
}
603
587
604
- let mut ds = f. debug_struct ( "Config" ) ;
605
- ds . field ( "user" , & self . user )
588
+ f. debug_struct ( "Config" )
589
+ . field ( "user" , & self . user )
606
590
. field ( "password" , & self . password . as_ref ( ) . map ( |_| Redaction { } ) )
607
591
. field ( "dbname" , & self . dbname )
608
592
. field ( "options" , & self . options )
@@ -612,19 +596,10 @@ impl fmt::Debug for Config {
612
596
. field ( "port" , & self . port )
613
597
. field ( "connect_timeout" , & self . connect_timeout )
614
598
. field ( "keepalives" , & self . keepalives )
615
- . field ( "keepalives_idle" , & self . keepalive_config . idle ) ;
616
-
617
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" ) ) ) ]
618
- {
619
- ds. field ( "keepalives_interval" , & self . keepalive_config . interval ) ;
620
- }
621
-
622
- #[ cfg( not( any( target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
623
- {
624
- ds. field ( "keepalives_retries" , & self . keepalive_config . retries ) ;
625
- }
626
-
627
- ds. field ( "target_session_attrs" , & self . target_session_attrs )
599
+ . field ( "keepalives_idle" , & self . keepalive_config . idle )
600
+ . field ( "keepalives_interval" , & self . keepalive_config . interval )
601
+ . field ( "keepalives_retries" , & self . keepalive_config . retries )
602
+ . field ( "target_session_attrs" , & self . target_session_attrs )
628
603
. field ( "channel_binding" , & self . channel_binding )
629
604
. finish ( )
630
605
}
0 commit comments