File tree 3 files changed +57
-0
lines changed
3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ impl Connection {
89
89
host_addrs_vec
90
90
}
91
91
92
+ #[ cfg( unix) ]
92
93
#[ getter]
93
94
fn hosts ( & self ) -> Vec < String > {
94
95
let mut hosts_vec = vec ! [ ] ;
@@ -108,6 +109,24 @@ impl Connection {
108
109
hosts_vec
109
110
}
110
111
112
+ #[ cfg( not( unix) ) ]
113
+ #[ getter]
114
+ fn hosts ( & self ) -> Vec < String > {
115
+ let mut hosts_vec = vec ! [ ] ;
116
+
117
+ let hosts = self . pg_config . get_hosts ( ) ;
118
+ for host in hosts {
119
+ match host {
120
+ Host :: Tcp ( host) => {
121
+ hosts_vec. push ( host. to_string ( ) ) ;
122
+ }
123
+ _ => unreachable ! ( ) ,
124
+ }
125
+ }
126
+
127
+ hosts_vec
128
+ }
129
+
111
130
#[ getter]
112
131
fn ports ( & self ) -> Vec < & u16 > {
113
132
return self . pg_config . get_ports ( ) . iter ( ) . collect :: < Vec < & u16 > > ( ) ;
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ impl Cursor {
160
160
host_addrs_vec
161
161
}
162
162
163
+ #[ cfg( unix) ]
163
164
#[ getter]
164
165
fn hosts ( & self ) -> Vec < String > {
165
166
let mut hosts_vec = vec ! [ ] ;
@@ -179,6 +180,24 @@ impl Cursor {
179
180
hosts_vec
180
181
}
181
182
183
+ #[ cfg( not( unix) ) ]
184
+ #[ getter]
185
+ fn hosts ( & self ) -> Vec < String > {
186
+ let mut hosts_vec = vec ! [ ] ;
187
+
188
+ let hosts = self . pg_config . get_hosts ( ) ;
189
+ for host in hosts {
190
+ match host {
191
+ Host :: Tcp ( host) => {
192
+ hosts_vec. push ( host. to_string ( ) ) ;
193
+ }
194
+ _ => unreachable ! ( ) ,
195
+ }
196
+ }
197
+
198
+ hosts_vec
199
+ }
200
+
182
201
#[ getter]
183
202
fn ports ( & self ) -> Vec < & u16 > {
184
203
return self . pg_config . get_ports ( ) . iter ( ) . collect :: < Vec < & u16 > > ( ) ;
Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ impl Transaction {
190
190
host_addrs_vec
191
191
}
192
192
193
+ #[ cfg( unix) ]
193
194
#[ getter]
194
195
fn hosts ( & self ) -> Vec < String > {
195
196
let mut hosts_vec = vec ! [ ] ;
@@ -209,6 +210,24 @@ impl Transaction {
209
210
hosts_vec
210
211
}
211
212
213
+ #[ cfg( not( unix) ) ]
214
+ #[ getter]
215
+ fn hosts ( & self ) -> Vec < String > {
216
+ let mut hosts_vec = vec ! [ ] ;
217
+
218
+ let hosts = self . pg_config . get_hosts ( ) ;
219
+ for host in hosts {
220
+ match host {
221
+ Host :: Tcp ( host) => {
222
+ hosts_vec. push ( host. to_string ( ) ) ;
223
+ }
224
+ _ => unreachable ! ( ) ,
225
+ }
226
+ }
227
+
228
+ hosts_vec
229
+ }
230
+
212
231
#[ getter]
213
232
fn ports ( & self ) -> Vec < & u16 > {
214
233
return self . pg_config . get_ports ( ) . iter ( ) . collect :: < Vec < & u16 > > ( ) ;
You can’t perform that action at this time.
0 commit comments