Re-exports
pub use async_trait;
pub use bytecheck;
pub use parking_lot;
pub use rkyv;
pub use rkyv_derive;
pub use tokio;
pub use tokio_macros;
pub use tokio_tungstenite::tungstenite;
pub use tracing;
Macros
- A macro to create a factory function for a handler. Example:
Structs
- An archived
StateUpdate
- An archived
Topic
- Configuration for a HL client
- When compressing data, the compression level can be specified by a value in this enum.
- A struct that allows the application server to emit events onto the event switch.
- The event switch is responsible for routing events from the application to the subscribed connections.
- A struct that allows the RPC handler to tell the connection handler about the topics it’s interested in
- The HardLight server, using tokio & tungstenite.
- An update sent from the connection handler to the client to keep connection state synchronized.
- The resolver for an archived
StateUpdate
- A topic that can be subscribed to.
- The resolver for an archived
Topic
Enums
- An archived
ClientMessage
- An archived
RpcHandlerError
- An archived
ServerMessage
- The resolver for an archived
ClientMessage
- Proxied subscription notifications are what the application handler sends to the connection manager to tell it to subscribe/unsubscribe to/from topics. The connection handler then does the hard work of talking to the event switch and sending events down the connection.
- The resolver for an archived
RpcHandlerError
- The resolver for an archived
ServerMessage
- Subscription notifications are sent from connection managers to the event switch to subscribe/unsubscribe the connection to/from topics.
- Sent by the event switch to the application to tell it when topics are created or removed.
Constants
Traits
- ApplicationClient is generated by the [connection_state] macro
- ClientState is generated by the [connection_state] macro
- A ServerHandler will be created for each connection to the server. These are user-defined structs that respond to RPC calls
Functions
- Deserializes a slice of bytes into a type that implements Archive.
- Awaits a future and serializes the result. This is a helper function for implementing ServerHandler::handle_rpc_call.
Type Definitions
- The RpcResponseSender is used to send the response of an RPC call back to the application. When an application sends an RPC call to the server, it will provide a serialized RPC call (method + args) and one of these senders. The application will await the response on the receiver side of the channel.
- A tokio MPSC channel that is used to send state updates to the runtime. The runtime will then send these updates to the client.
Attribute Macros
- Takes any ast as an input and annotates it with useful attributes for data serialization and deserialization. This consists of
Archive + Serialize + Deserialize
, for the root type andCheckBytes
for the archived version. - This attribute is used to mark a struct as an RPC handler. Currently, this just adds the
#[async_trait::async_trait]
attribute to the struct.