#[repr(transparent)]pub struct OwnedSocket { /* private fields */ }
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
sourceimpl OwnedSocket
impl OwnedSocket
Trait Implementations
sourceimpl AsRawSocket for OwnedSocket
impl AsRawSocket for OwnedSocket
sourcefn as_raw_socket(&self) -> RawSocket
fn as_raw_socket(&self) -> RawSocket
Extracts the raw socket. Read more
sourceimpl AsSocket for OwnedSocket
impl AsSocket for OwnedSocket
sourcefn as_socket(&self) -> BorrowedSocket<'_>
fn as_socket(&self) -> BorrowedSocket<'_>
Borrows the socket.
sourceimpl Debug for OwnedSocket
impl Debug for OwnedSocket
sourceimpl Drop for OwnedSocket
impl Drop for OwnedSocket
sourceimpl From<OwnedSocket> for TcpListener
impl From<OwnedSocket> for TcpListener
sourcefn from(owned: OwnedSocket) -> Self
fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
sourceimpl From<OwnedSocket> for TcpStream
impl From<OwnedSocket> for TcpStream
sourcefn from(owned: OwnedSocket) -> Self
fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
sourceimpl From<OwnedSocket> for UdpSocket
impl From<OwnedSocket> for UdpSocket
sourcefn from(owned: OwnedSocket) -> Self
fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
sourceimpl From<TcpListener> for OwnedSocket
impl From<TcpListener> for OwnedSocket
sourcefn from(tcp_listener: TcpListener) -> OwnedSocket
fn from(tcp_listener: TcpListener) -> OwnedSocket
Converts to this type from the input type.
sourceimpl From<TcpStream> for OwnedSocket
impl From<TcpStream> for OwnedSocket
sourcefn from(tcp_stream: TcpStream) -> OwnedSocket
fn from(tcp_stream: TcpStream) -> OwnedSocket
Converts to this type from the input type.
sourceimpl From<UdpSocket> for OwnedSocket
impl From<UdpSocket> for OwnedSocket
sourcefn from(udp_socket: UdpSocket) -> OwnedSocket
fn from(udp_socket: UdpSocket) -> OwnedSocket
Converts to this type from the input type.
sourceimpl FromRawSocket for OwnedSocket
impl FromRawSocket for OwnedSocket
sourceunsafe 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
sourceimpl IntoRawSocket for OwnedSocket
impl IntoRawSocket for OwnedSocket
sourcefn 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 RefUnwindSafe for OwnedSocket
impl Send for OwnedSocket
impl Sync for OwnedSocket
impl Unpin for OwnedSocket
impl UnwindSafe for OwnedSocket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more