Expand description
This module provides the basic types necessary to be able to handle connections and message transmission in both synchronous and asynchronous contexts.
The types here should simplify implementation of higher level layers and protocols.
Structs§
- Async
Mutex - An asynchronous
Mutex
-like type. - Async
Mutex Guard - A handle to a held
Mutex
. The guard can be held across any.await
point as it isSend
. - Async
RwLock - An asynchronous reader-writer lock.
- RUMClient
- This structs encapsulates the tokio::net::TcpStream instance that will be our adapter for connecting and sending messages to a peer or server.
- RUMClient
Handle - Handle struct containing a reference to the global Tokio runtime and an instance of SafeClient. This handle allows sync codebases to interact with the async primitives built on top of Tokio. Specifically, this handle allows wrapping of the async connect, send, and receive methods implemented in RUMClient.
- RUMServer
- This is the Server primitive that listens for incoming connections and manages “low-level” messages.
- RUMServer
Handle - Handle struct containing a reference to the global Tokio runtime and an instance of SafeServer. This handle allows sync codebases to interact with the async primitives built on top of Tokio. Specifically, this handle allows wrapping of the async bind, send, receive, and start methods implemented in RUMServer. In addition, this handle allows spinning a server in a fully non-blocking manner. Meaning, you can call start, which will immediately return after queueing the task in the tokio queue. You can then query the server for incoming data or submit your own data while the server is operating in the background. The server can be handling incoming data at the “same” time you are trying to queue your own message.
- RwLock
Read Guard - RAII structure used to release the shared read access of a lock when dropped.
- RwLock
Write Guard - RAII structure used to release the exclusive write access of a lock when dropped.
- TcpListener
- A TCP socket server, listening for connections.
- TcpStream
- A TCP stream between a local and a remote socket.
Enums§
- SOCKET_
READINESS_ TYPE - Enum used for selecting which clients to iterate through. Pass SOCKET_READINESS_TYPE::NONE to ignore filtering by readiness type.
Constants§
- ANYHOST
- Convenience constant for the
0.0.0.0
address. This is to be used in contexts in which you do not have any interface preference. - LOCALHOST
- Convenience constant to localhost
Type Aliases§
- ClientID
List - List of client IDs that you can interact with.
- Client
List - List of clients that you can interact with.
- Connection
Info - RUMNet
Message - ReceivedRUM
NetMessage - Safe
Client - Safe
Listener - Safe
Server