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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
// This file was automatically generated by `elaborate`.
// https://github.com/trailofbits/elaborate
#[allow(unused_imports)]
use anyhow::Context;
#[cfg(feature = "windows_unix_domain_sockets")]
#[cfg(windows)]
pub trait SocketAddrContext: Sized {
/// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.
///
/// # Errors
///
/// Returns an error if the path is longer than `SUN_LEN` or if it contains
/// NULL bytes.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::SocketAddr;
/// use std::path::Path;
///
/// # fn main() -> std::io::Result<()> {
/// let address = SocketAddr::from_pathname("/path/to/socket")?;
/// assert_eq!(address.as_pathname(), Some(Path::new("/path/to/socket")));
/// # Ok(())
/// # }
/// ```
///
/// Creating a `SocketAddr` with a NULL byte results in an error.
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::SocketAddr;
///
/// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err());
/// ```
fn from_pathname_wc < P > ( path : P ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) where P : core :: convert :: AsRef < std :: path :: Path >;
/// Returns the contents of this address if it is a `pathname` address.
///
/// # Examples
///
/// With a pathname:
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
/// use std::path::Path;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixListener::bind("/tmp/sock")?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// assert_eq!(addr.as_pathname(), Some(Path::new("/tmp/sock")));
/// Ok(())
/// }
/// ```
fn as_pathname_wc ( & self ) -> crate :: rewrite_output_type ! ( core :: option :: Option < & std :: path :: Path > );
}
#[cfg(feature = "windows_unix_domain_sockets")]
#[cfg(windows)]
impl SocketAddrContext for std :: os :: windows :: net :: SocketAddr {
fn from_pathname_wc < P > ( path : P ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) where P : core :: convert :: AsRef < std :: path :: Path > {
let path = path.as_ref();
std :: os :: windows :: net :: SocketAddr :: from_pathname(path)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::net::SocketAddr::from_pathname", path))
}
fn as_pathname_wc ( & self ) -> crate :: rewrite_output_type ! ( core :: option :: Option < & std :: path :: Path > ) {
std :: os :: windows :: net :: SocketAddr :: as_pathname(self)
.with_context(|| crate::call_failed!(Some(self), "as_pathname"))
}
}
#[cfg(feature = "windows_unix_domain_sockets")]
#[cfg(windows)]
pub trait UnixListenerContext: Sized {
/// Accepts a new incoming connection to this listener.
///
/// This function will block the calling thread until a new Unix connection
/// is established. When established, the corresponding [`UnixStream`] and
/// the remote peer's address will be returned.
///
/// [`UnixStream`]: crate::os::windows::net::UnixStream
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
///
/// match listener.accept() {
/// Ok((socket, addr)) => println!("Got a client: {addr:?}"),
/// Err(e) => println!("accept function failed: {e:?}"),
/// }
/// Ok(())
/// }
/// ```
fn accept_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( std :: os :: windows :: net :: UnixStream , std :: os :: windows :: net :: SocketAddr ) > );
/// Creates a new `UnixListener` bound to the specified [`socket address`].
///
/// [`socket address`]: crate::os::windows::net::SocketAddr
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::{UnixListener};
///
/// fn main() -> std::io::Result<()> {
/// let listener1 = UnixListener::bind("path/to/socket")?;
/// let addr = listener1.local_addr()?;
///
/// let listener2 = match UnixListener::bind_addr(&addr) {
/// Ok(sock) => sock,
/// Err(err) => {
/// println!("Couldn't bind: {err:?}");
/// return Err(err);
/// }
/// };
/// Ok(())
/// }
/// ```
fn bind_addr_wc ( socket_addr : & std :: os :: windows :: net :: SocketAddr ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
/// Creates a new `UnixListener` bound to the specified socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
/// let listener = match UnixListener::bind("/path/to/the/socket") {
/// Ok(sock) => sock,
/// Err(e) => {
/// println!("Couldn't connect: {e:?}");
/// return
/// }
/// };
/// ```
fn bind_wc < P : core :: convert :: AsRef < std :: path :: Path > > ( path : P ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
/// Creates a new independently owned handle to the underlying socket.
///
/// The returned `UnixListener` is a reference to the same socket that this
/// object references. Both handles can be used to accept incoming
/// connections and options set on one listener will affect the other.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// let listener_copy = listener.try_clone().expect("try_clone failed");
/// Ok(())
/// }
/// ```
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
/// Moves the socket into or out of nonblocking mode.
///
/// This will result in the `accept` operation becoming nonblocking,
/// i.e., immediately returning from their calls. If the IO operation is
/// successful, `Ok` is returned and no further action is required. If the
/// IO operation could not be completed and needs to be retried, an error
/// with kind [`io::ErrorKind::WouldBlock`] is returned.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// listener.set_nonblocking(true).expect("Couldn't set non blocking");
/// Ok(())
/// }
/// ```
fn set_nonblocking_wc ( & self , nonblocking : bool ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > );
/// Returns the local socket address of this listener.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// let addr = listener.local_addr().expect("Couldn't get local address");
/// Ok(())
/// }
/// ```
fn local_addr_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: net :: SocketAddr > );
/// Returns the value of the `SO_ERROR` option.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixListener;
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/tmp/sock")?;
///
/// if let Ok(Some(err)) = listener.take_error() {
/// println!("Got error: {err:?}");
/// }
/// Ok(())
/// }
/// ```
fn take_error_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < std :: io :: Error > > );
}
#[cfg(feature = "windows_unix_domain_sockets")]
#[cfg(windows)]
impl UnixListenerContext for std :: os :: windows :: net :: UnixListener {
fn accept_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( std :: os :: windows :: net :: UnixStream , std :: os :: windows :: net :: SocketAddr ) > ) {
std :: os :: windows :: net :: UnixListener :: accept(self)
.with_context(|| crate::call_failed!(Some(self), "accept"))
}
fn bind_addr_wc ( socket_addr : & std :: os :: windows :: net :: SocketAddr ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
std :: os :: windows :: net :: UnixListener :: bind_addr(socket_addr)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::net::UnixListener::bind_addr", socket_addr))
}
fn bind_wc < P : core :: convert :: AsRef < std :: path :: Path > > ( path : P ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
let path = path.as_ref();
std :: os :: windows :: net :: UnixListener :: bind(path)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::net::UnixListener::bind", path))
}
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
std :: os :: windows :: net :: UnixListener :: try_clone(self)
.with_context(|| crate::call_failed!(Some(self), "try_clone"))
}
fn set_nonblocking_wc ( & self , nonblocking : bool ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
std :: os :: windows :: net :: UnixListener :: set_nonblocking(self, nonblocking)
.with_context(|| crate::call_failed!(Some(self), "set_nonblocking", nonblocking))
}
fn local_addr_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: net :: SocketAddr > ) {
std :: os :: windows :: net :: UnixListener :: local_addr(self)
.with_context(|| crate::call_failed!(Some(self), "local_addr"))
}
fn take_error_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < std :: io :: Error > > ) {
std :: os :: windows :: net :: UnixListener :: take_error(self)
.with_context(|| crate::call_failed!(Some(self), "take_error"))
}
}
#[cfg(feature = "windows_unix_domain_sockets")]
#[cfg(windows)]
pub trait UnixStreamContext: Sized {
/// Connects to the socket named by `path`.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
///
/// let socket = match UnixStream::connect("/tmp/sock") {
/// Ok(sock) => sock,
/// Err(e) => {
/// println!("Couldn't connect: {e:?}");
/// return
/// }
/// };
/// ```
fn connect_wc < P : core :: convert :: AsRef < std :: path :: Path > > ( path : P ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
/// Connects to the socket specified by [`address`].
///
/// [`address`]: crate::os::windows::net::SocketAddr
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::{UnixListener, UnixStream};
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// let addr = listener.local_addr()?;
///
/// let sock = match UnixStream::connect_addr(&addr) {
/// Ok(sock) => sock,
/// Err(e) => {
/// println!("Couldn't connect: {e:?}");
/// return Err(e)
/// }
/// };
/// Ok(())
/// }
/// ````
fn connect_addr_wc ( socket_addr : & std :: os :: windows :: net :: SocketAddr ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
/// Creates a new independently owned handle to the underlying socket.
///
/// The returned `UnixStream` is a reference to the same stream that this
/// object references. Both handles will read and write the same stream of
/// data, and options set on one stream will be propagated to the other
/// stream.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let sock_copy = socket.try_clone().expect("Couldn't clone socket");
/// Ok(())
/// }
/// ```
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
/// Moves the socket into or out of nonblocking mode.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_nonblocking(true).expect("Couldn't set nonblocking");
/// Ok(())
/// }
/// ```
fn set_nonblocking_wc ( & self , nonblocking : bool ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > );
/// Returns the read timeout of this socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
/// use std::time::Duration;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
/// assert_eq!(socket.read_timeout()?, Some(Duration::new(1, 0)));
/// Ok(())
/// }
/// ```
fn read_timeout_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < core :: time :: Duration > > );
/// Returns the socket address of the local half of this connection.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// Ok(())
/// }
/// ```
fn local_addr_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: net :: SocketAddr > );
/// Returns the socket address of the remote half of this connection.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let addr = socket.peer_addr().expect("Couldn't get peer address");
/// Ok(())
/// }
/// ```
fn peer_addr_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: net :: SocketAddr > );
/// Returns the value of the `SO_ERROR` option.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// if let Ok(Some(err)) = socket.take_error() {
/// println!("Got error: {err:?}");
/// }
/// Ok(())
/// }
/// ```
fn take_error_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < std :: io :: Error > > );
/// Returns the write timeout of this socket.
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
/// use std::time::Duration;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_write_timeout(Some(Duration::new(1, 0)))
/// .expect("Couldn't set write timeout");
/// assert_eq!(socket.write_timeout()?, Some(Duration::new(1, 0)));
/// Ok(())
/// }
/// ```
fn write_timeout_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < core :: time :: Duration > > );
/// Sets the read timeout for the socket.
///
/// If the provided value is [`None`], then [`read`] calls will block
/// indefinitely. An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method.
///
/// [`read`]: io::Read::read
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
/// use std::time::Duration;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
/// Ok(())
/// }
/// ```
///
/// An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method:
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::io;
/// use std::os::windows::net::UnixStream;
/// use std::time::Duration;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let result = socket.set_read_timeout(Some(Duration::new(0, 0)));
/// let err = result.unwrap_err();
/// assert_eq!(err.kind(), io::ErrorKind::InvalidInput);
/// Ok(())
/// }
/// ```
fn set_read_timeout_wc ( & self , dur : core :: option :: Option < core :: time :: Duration > ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > );
/// Sets the write timeout for the socket.
///
/// If the provided value is [`None`], then [`write`] calls will block
/// indefinitely. An [`Err`] is returned if the zero [`Duration`] is
/// passed to this method.
///
/// [`read`]: io::Read::read
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
/// use std::time::Duration;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_write_timeout(Some(Duration::new(1, 0)))
/// .expect("Couldn't set write timeout");
/// Ok(())
/// }
/// ```
///
/// An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method:
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::io;
/// use std::os::windows::net::UnixStream;
/// use std::time::Duration;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let result = socket.set_write_timeout(Some(Duration::new(0, 0)));
/// let err = result.unwrap_err();
/// assert_eq!(err.kind(), io::ErrorKind::InvalidInput);
/// Ok(())
/// }
/// ```
fn set_write_timeout_wc ( & self , dur : core :: option :: Option < core :: time :: Duration > ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > );
/// Shuts down the read, write, or both halves of this connection.
///
/// This function will cause all pending and future I/O calls on the
/// specified portions to immediately return with an appropriate value
/// (see the documentation of [`Shutdown`]).
///
/// # Examples
///
/// ```no_run
/// #![feature(windows_unix_domain_sockets)]
/// use std::os::windows::net::UnixStream;
/// use std::net::Shutdown;
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.shutdown(Shutdown::Both).expect("shutdown function failed");
/// Ok(())
/// }
/// ```
fn shutdown_wc ( & self , how : std :: net :: Shutdown ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > );
}
#[cfg(feature = "windows_unix_domain_sockets")]
#[cfg(windows)]
impl UnixStreamContext for std :: os :: windows :: net :: UnixStream {
fn connect_wc < P : core :: convert :: AsRef < std :: path :: Path > > ( path : P ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
let path = path.as_ref();
std :: os :: windows :: net :: UnixStream :: connect(path)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::net::UnixStream::connect", path))
}
fn connect_addr_wc ( socket_addr : & std :: os :: windows :: net :: SocketAddr ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
std :: os :: windows :: net :: UnixStream :: connect_addr(socket_addr)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::net::UnixStream::connect_addr", socket_addr))
}
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
std :: os :: windows :: net :: UnixStream :: try_clone(self)
.with_context(|| crate::call_failed!(Some(self), "try_clone"))
}
fn set_nonblocking_wc ( & self , nonblocking : bool ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
std :: os :: windows :: net :: UnixStream :: set_nonblocking(self, nonblocking)
.with_context(|| crate::call_failed!(Some(self), "set_nonblocking", nonblocking))
}
fn read_timeout_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < core :: time :: Duration > > ) {
std :: os :: windows :: net :: UnixStream :: read_timeout(self)
.with_context(|| crate::call_failed!(Some(self), "read_timeout"))
}
fn local_addr_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: net :: SocketAddr > ) {
std :: os :: windows :: net :: UnixStream :: local_addr(self)
.with_context(|| crate::call_failed!(Some(self), "local_addr"))
}
fn peer_addr_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: net :: SocketAddr > ) {
std :: os :: windows :: net :: UnixStream :: peer_addr(self)
.with_context(|| crate::call_failed!(Some(self), "peer_addr"))
}
fn take_error_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < std :: io :: Error > > ) {
std :: os :: windows :: net :: UnixStream :: take_error(self)
.with_context(|| crate::call_failed!(Some(self), "take_error"))
}
fn write_timeout_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < core :: option :: Option < core :: time :: Duration > > ) {
std :: os :: windows :: net :: UnixStream :: write_timeout(self)
.with_context(|| crate::call_failed!(Some(self), "write_timeout"))
}
fn set_read_timeout_wc ( & self , dur : core :: option :: Option < core :: time :: Duration > ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
std :: os :: windows :: net :: UnixStream :: set_read_timeout(self, dur)
.with_context(|| crate::call_failed!(Some(self), "set_read_timeout", dur))
}
fn set_write_timeout_wc ( & self , dur : core :: option :: Option < core :: time :: Duration > ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
std :: os :: windows :: net :: UnixStream :: set_write_timeout(self, dur)
.with_context(|| crate::call_failed!(Some(self), "set_write_timeout", dur))
}
fn shutdown_wc ( & self , how : std :: net :: Shutdown ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
std :: os :: windows :: net :: UnixStream :: shutdown(self, how)
.with_context(|| crate::call_failed!(Some(self), "shutdown", how))
}
}