On this page
Struct std::os::windows::io::OwnedSocket
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
.
Implementations
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.
Trait Implementations
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
impl From<TcpStream> for OwnedSocket
fn from(tcp_stream: TcpStream) -> OwnedSocket
impl From<UdpSocket> for OwnedSocket
fn from(udp_socket: UdpSocket) -> OwnedSocket
impl FromRawSocket for OwnedSocket
unsafe fn from_raw_socket(socket: RawSocket) -> Self
impl IntoRawSocket for OwnedSocket
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> Any for T
where
T: 'static + ?Sized,
impl<T> Borrow<T> for T
where
T: ?Sized,
impl<T> BorrowMut<T> for T
where
T: ?Sized,
impl<T> From<T> for T
fn from(t: T) -> T
Returns the argument unchanged.
impl<T, U> Into<U> for T
where
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 T
where
U: Into<T>,
type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for T
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
© 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