Struct io_lifetimes::OwnedSocket
1.63.0 · source · [−]#[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
sourcepub fn try_clone(&self) -> Result<OwnedSocket, Error>
pub fn try_clone(&self) -> Result<OwnedSocket, Error>
Creates a new OwnedSocket
instance that shares the same underlying
object as the existing OwnedSocket
instance.
Trait Implementations
sourceimpl AsRawSocket for OwnedSocket
impl AsRawSocket for OwnedSocket
sourcefn as_raw_socket(&self) -> u32
fn as_raw_socket(&self) -> u32
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<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: u32) -> OwnedSocket
unsafe fn from_raw_socket(socket: u32) -> OwnedSocket
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) -> u32
fn into_raw_socket(self) -> u32
Consumes this object, returning the raw underlying socket. Read more
impl SocketlikeViewType 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
sourceimpl<T> AsRawSocketlike for T where
T: AsRawSocket,
impl<T> AsRawSocketlike for T where
T: AsRawSocket,
sourcefn as_raw_socketlike(&self) -> u32
fn as_raw_socketlike(&self) -> u32
Returns the raw value.
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
sourceimpl<T> FromRawSocketlike for T where
T: FromRawSocket,
impl<T> FromRawSocketlike for T where
T: FromRawSocket,
sourceunsafe fn from_raw_socketlike(raw: u32) -> T
unsafe fn from_raw_socketlike(raw: u32) -> T
Constructs Self
from the raw value.
sourceimpl<T> IntoRawSocketlike for T where
T: IntoRawSocket,
impl<T> IntoRawSocketlike for T where
T: IntoRawSocket,
sourcefn into_raw_socketlike(self) -> u32
fn into_raw_socketlike(self) -> u32
Returns the raw value.