#[repr(transparent)]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
impl AsRawSocket for OwnedSocket
source
impl AsRawSocket for OwnedSocket
sourcefn as_raw_socket(&self) -> RawSocket
source
fn as_raw_socket(&self) -> RawSocket
sourceExtracts the raw socket. Read more
impl AsSocket for OwnedSocket
source
impl AsSocket for OwnedSocket
sourceimpl Debug for OwnedSocket
source
impl Debug for OwnedSocket
sourceimpl Drop for OwnedSocket
source
impl Drop for OwnedSocket
sourceimpl From<OwnedSocket> for TcpStream
source
impl From<OwnedSocket> for TcpStream
sourcefn from(owned: OwnedSocket) -> Self
source
fn from(owned: OwnedSocket) -> Self
sourceConverts to this type from the input type.
impl From<OwnedSocket> for TcpListener
source
impl From<OwnedSocket> for TcpListener
sourcefn from(owned: OwnedSocket) -> Self
source
fn from(owned: OwnedSocket) -> Self
sourceConverts to this type from the input type.
impl From<OwnedSocket> for UdpSocket
source
impl From<OwnedSocket> for UdpSocket
sourcefn from(owned: OwnedSocket) -> Self
source
fn from(owned: OwnedSocket) -> Self
sourceConverts to this type from the input type.
impl From<TcpListener> for OwnedSocket
source
impl From<TcpListener> for OwnedSocket
sourcefn from(tcp_listener: TcpListener) -> OwnedSocket
source
fn from(tcp_listener: TcpListener) -> OwnedSocket
sourceConverts to this type from the input type.
impl From<TcpStream> for OwnedSocket
source
impl From<TcpStream> for OwnedSocket
sourcefn from(tcp_stream: TcpStream) -> OwnedSocket
source
fn from(tcp_stream: TcpStream) -> OwnedSocket
sourceConverts to this type from the input type.
impl From<UdpSocket> for OwnedSocket
source
impl From<UdpSocket> for OwnedSocket
sourcefn from(udp_socket: UdpSocket) -> OwnedSocket
source
fn from(udp_socket: UdpSocket) -> OwnedSocket
sourceConverts to this type from the input type.
impl FromRawSocket for OwnedSocket
source
impl FromRawSocket for OwnedSocket
sourceunsafe fn from_raw_socket(socket: RawSocket) -> Self
source
unsafe fn from_raw_socket(socket: RawSocket) -> Self
sourceConstructs a new I/O object from the specified raw socket. Read more
impl IntoRawSocket for OwnedSocket
source
impl IntoRawSocket for OwnedSocket
sourcefn into_raw_socket(self) -> RawSocket
source
fn into_raw_socket(self) -> RawSocket
sourceConsumes this object, returning the raw underlying socket. Read more
Auto Trait Implementations
impl RefUnwindSafe for OwnedSocket
impl Send for OwnedSocket
impl Sync for OwnedSocket
impl Unpin for OwnedSocket
impl UnwindSafe for OwnedSocket
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
source
impl<T> BorrowMut<T> for T where
T: ?Sized,
sourcefn borrow_mut(&mut self) -> &mut T
const: unstable · source
fn borrow_mut(&mut self) -> &mut T
const: unstable · sourceMutably borrows from an owned value. Read more