pub struct OwnedSocket { /* private fields */ }
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.
impl OwnedSocket
pub fn try_clone(&self) -> Result<Self>
Creates a new OwnedSocket instance that shares the same underlying object as the existing OwnedSocket instance.
impl AsRawSocket for OwnedSocket
impl AsSocket for OwnedSocket
fn as_socket(&self) -> BorrowedSocket<'_>
impl Debug for OwnedSocket
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Drop for OwnedSocket
impl From<OwnedSocket> for TcpListener
fn from(owned: OwnedSocket) -> Self
impl From<OwnedSocket> for TcpStream
fn from(owned: OwnedSocket) -> Self
impl From<OwnedSocket> for UdpSocket
fn from(owned: OwnedSocket) -> Self
impl From<TcpListener> for OwnedSocket
fn from(tcp_listener: TcpListener) -> OwnedSocket
Takes ownership of a TcpListener’s socket.
impl From<TcpStream> for OwnedSocket
impl From<UdpSocket> for OwnedSocket
fn from(udp_socket: UdpSocket) -> OwnedSocket
Takes ownership of a UdpSocket’s underlying socket.
impl FromRawSocket for OwnedSocket
unsafe fn from_raw_socket(socket: RawSocket) -> Self
impl IntoRawSocket for OwnedSocket
impl Freeze for OwnedSocket
impl RefUnwindSafe for OwnedSocket
impl Send for OwnedSocket
impl Sync for OwnedSocket
impl Unpin for OwnedSocket
impl UnwindSafe for OwnedSocket
impl<T> Any for Twhere
T: 'static + ?Sized,impl<T> Borrow<T> for Twhere
T: ?Sized,impl<T> BorrowMut<T> for Twhere
T: ?Sized,impl<T> From<T> for T
fn from(t: T) -> T
Returns the argument unchanged.
impl<T, U> Into<U> for Twhere
U: From<T>,fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of From<T> for U chooses to do.
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/os/windows/io/struct.OwnedSocket.html