pub struct OwnedSocket { /* private fields */ }
Available on Windows only.
Expand description
An owned socket.
This closes the socket on drop.
This uses repr(transparent)
and has the representation of a host socket,
so it can be used in FFI in places where a socket is passed as a consumed
argument or returned as an owned value, and it never has the value
INVALID_SOCKET
.
Implementations§
Trait Implementations§
1.63.0 · Source§impl AsRawSocket for OwnedSocket
impl AsRawSocket for OwnedSocket
Source§fn as_raw_socket(&self) -> RawSocket
fn as_raw_socket(&self) -> RawSocket
Extracts the raw socket. Read more
1.63.0 · Source§impl AsSocket for OwnedSocket
impl AsSocket for OwnedSocket
Source§fn as_socket(&self) -> BorrowedSocket<'_>
fn as_socket(&self) -> BorrowedSocket<'_>
Borrows the socket.
1.63.0 · Source§impl Debug for OwnedSocket
impl Debug for OwnedSocket
1.63.0 · Source§impl Drop for OwnedSocket
impl Drop for OwnedSocket
1.63.0 · Source§impl From<OwnedSocket> for TcpListener
impl From<OwnedSocket> for TcpListener
Source§fn from(owned: OwnedSocket) -> Self
fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
1.63.0 · Source§impl From<OwnedSocket> for TcpStream
impl From<OwnedSocket> for TcpStream
Source§fn from(owned: OwnedSocket) -> Self
fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
1.63.0 · Source§impl From<OwnedSocket> for UdpSocket
impl From<OwnedSocket> for UdpSocket
Source§fn from(owned: OwnedSocket) -> Self
fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
1.63.0 · Source§impl From<TcpListener> for OwnedSocket
impl From<TcpListener> for OwnedSocket
Source§fn from(tcp_listener: TcpListener) -> OwnedSocket
fn from(tcp_listener: TcpListener) -> OwnedSocket
Takes ownership of a TcpListener
’s socket.
1.63.0 · Source§impl From<TcpStream> for OwnedSocket
impl From<TcpStream> for OwnedSocket
1.63.0 · Source§impl From<UdpSocket> for OwnedSocket
impl From<UdpSocket> for OwnedSocket
1.63.0 · Source§impl FromRawSocket for OwnedSocket
impl FromRawSocket for OwnedSocket
Source§unsafe fn from_raw_socket(socket: RawSocket) -> Self
unsafe fn from_raw_socket(socket: RawSocket) -> Self
Constructs a new I/O object from the specified raw socket. Read more
1.63.0 · Source§impl IntoRawSocket for OwnedSocket
impl IntoRawSocket for OwnedSocket
Source§fn into_raw_socket(self) -> RawSocket
fn into_raw_socket(self) -> RawSocket
Consumes this object, returning the raw underlying socket. Read more
Auto Trait Implementations§
impl Freeze for OwnedSocket
impl RefUnwindSafe for OwnedSocket
impl Send for OwnedSocket
impl Sync for OwnedSocket
impl Unpin for OwnedSocket
impl UnwindSafe for OwnedSocket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more