#[repr(transparent)]
pub struct OwnedSocket { /* fields omitted */ }
🔬 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.

Trait Implementations

Extracts the underlying raw socket from this object.

🔬 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

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Constructs a new instance of Self from the given raw socket.

Safety

The resource pointed to by socket must be open and suitable for assuming ownership. The resource must not require cleanup other than closesocket.

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

Performs the conversion.

Performs the conversion.

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.