#[repr(transparent)]
pub struct OwnedSocket { /* private fields */ }
🔬 This is a nightly-only experimental API. (io_safety #87074)
This is supported 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

🔬 This is a nightly-only experimental API. (io_safety #87074)

Creates a new OwnedSocket instance that shares the same underlying socket as the existing OwnedSocket instance.

Trait Implementations

Extracts the raw socket. Read more

🔬 This is a nightly-only experimental API. (io_safety #87074)

Borrows the socket.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Constructs a new I/O object from the specified raw socket. Read more

Consumes this object, returning the raw underlying socket. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.