#[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

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

Trait Implementations

Extracts the underlying raw socket from this object.

Borrows the socket.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

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

Safety

The resource pointed to by raw must be open and suitable for assuming ownership.

Constructs a new instance of Self from the given socket.

Constructs a new instance of Self from the given socket converted from into_owned. Read more

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

Consumes this object, returning the underlying socket.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Returns the raw value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Constructs Self from the raw value.

Performs the conversion.

Returns the raw value.

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.