@@ -12,8 +12,6 @@ use super::{peer_cred, UCred};
12
12
#[ cfg( any( doc, target_os = "android" , target_os = "linux" ) ) ]
13
13
use super :: { recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary } ;
14
14
use super :: { sockaddr_un, SocketAddr } ;
15
- #[ cfg( any( doc, target_os = "linux" , target_os = "haiku" , target_os = "vxworks" , ) ) ]
16
- use crate :: ffi:: CString ;
17
15
use crate :: fmt;
18
16
use crate :: io:: { self , IoSlice , IoSliceMut } ;
19
17
use crate :: net:: Shutdown ;
@@ -407,58 +405,6 @@ impl UnixStream {
407
405
self . 0 . set_mark ( mark)
408
406
}
409
407
410
- /// Bind the socket to an interface
411
- ///
412
- #[ cfg_attr(
413
- any( target_os = "linux" , target_os = "haiku" , target_os = "vxworks" ) ,
414
- doc = "```no_run"
415
- ) ]
416
- #[ cfg_attr(
417
- not( any( target_os = "linux" , target_os = "haiku" , target_os = "vxworks" ) ) ,
418
- doc = "```ignore"
419
- ) ]
420
- /// #![feature(unix_set_device)]
421
- /// use std::os::unix::net::UnixStream;
422
- ///
423
- /// fn main() -> std::io::Result<()> {
424
- /// let socket = UnixStream::connect("/tmp/sock")?;
425
- /// socket.set_device("eth0")?;
426
- /// Ok(())
427
- /// }
428
- /// ```
429
- #[ cfg( any( doc, target_os = "linux" , target_os = "haiku" , target_os = "vxworks" , ) ) ]
430
- #[ unstable( feature = "unix_set_device" , issue = "129182" ) ]
431
- pub fn set_device ( & self , ifrname : & str ) -> io:: Result < ( ) > {
432
- self . 0 . set_device ( ifrname)
433
- }
434
-
435
- /// Get the interface this socket is bound to
436
- ///
437
- #[ cfg_attr(
438
- any( target_os = "linux" , target_os = "haiku" , target_os = "vxworks" ) ,
439
- doc = "```no_run"
440
- ) ]
441
- #[ cfg_attr(
442
- not( any( target_os = "linux" , target_os = "haiku" , target_os = "vxworks" ) ) ,
443
- doc = "```ignore"
444
- ) ]
445
- /// #![feature(unix_set_device)]
446
- /// use std::os::unix::net::UnixStream;
447
- ///
448
- /// fn main() -> std::io::Result<()> {
449
- /// let socket = UnixStream::connect("/tmp/sock")?;
450
- /// socket.set_device("eth0")?;
451
- /// let name = socket.device()?;
452
- /// assert_eq!(Ok("eth0"), name.to_str());
453
- /// Ok(())
454
- /// }
455
- /// ```
456
- #[ cfg( any( doc, target_os = "linux" , target_os = "haiku" , target_os = "vxworks" , ) ) ]
457
- #[ unstable( feature = "unix_set_device" , issue = "129182" ) ]
458
- pub fn device ( & self ) -> io:: Result < CString > {
459
- self . 0 . device ( )
460
- }
461
-
462
408
/// Returns the value of the `SO_ERROR` option.
463
409
///
464
410
/// # Examples
0 commit comments