Struct io_lifetimes::OwnedSocket
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
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 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 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 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(owned: TcpListener) -> Self
fn from(owned: TcpListener) -> Self
Converts to this type from the input type.
sourceimpl From<TcpStream> for OwnedSocket
impl From<TcpStream> for OwnedSocket
sourceimpl From<UdpSocket> for OwnedSocket
impl From<UdpSocket> for OwnedSocket
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 FromSocket for OwnedSocket
impl FromSocket for OwnedSocket
sourcefn from_socket(owned: OwnedSocket) -> Self
fn from_socket(owned: OwnedSocket) -> Self
Constructs a new instance of Self
from the given socket.
sourcefn from_into_socket<Owned: IntoSocket>(into_owned: Owned) -> Self where
Self: Sized,
fn from_into_socket<Owned: IntoSocket>(into_owned: Owned) -> Self where
Self: Sized,
Constructs a new instance of Self
from the given socket converted
from into_owned
. 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
sourceimpl IntoSocket for OwnedSocket
impl IntoSocket for OwnedSocket
sourcefn into_socket(self) -> OwnedSocket
fn into_socket(self) -> OwnedSocket
Consumes this object, returning the underlying socket.
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) -> u64
fn as_raw_socketlike(&self) -> u64
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: u64) -> T
unsafe fn from_raw_socketlike(raw: u64) -> 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) -> u64
fn into_raw_socketlike(self) -> u64
Returns the raw value.