pub struct GnsSocket<'x, 'y, S: GnsDroppable> { /* private fields */ }
Expand description

GnsSocket is the most important structure of this library. This structure is used to create client (GnsSocket<IsClient>) and server (GnsSocket<IsServer>) sockets via the GnsSocket::connect and GnsSocket::listen functions. The drop implementation make sure that everything related to this structure is correctly freed, except the GnsGlobal and GnsUtils instances and the user has a strong guarantee that all the available operations over the socket are safe.

Implementations

Get a connection lane status. This call is possible only if lanes has been previously configured using configure_connection_lanes

Initialize a new socket in IsCreated state.

Listen for incoming connections, the socket transition from IsCreated to IsServer, allowing a new set of server operations.

Connect to a remote host, the socket transition from IsCreated to IsClient, allowing a new set of client operations.

Accept an incoming connection. This operation is available only if the socket is in the IsServer state.

Return the socket connection. This operation is available only if the socket is in the IsClient state.

Trait Implementations

Executes the destructor for this type. 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.