Module reactive_messaging::prelude
source · Expand description
Re-exports of types useful for users of this crate
Structs
- Represents a channel to a peer able to send out
MessageTypekinds of messages from “here” to “there”
Enums
- The internal events a reactive processor (for a server or client) shares with the user code.
The user code may use those events to maintain a list of connected clients, be notified of stop/close/quit requests, init/deinit sessions, etc. Note that thePeerobjects received in those events may be used, at any time, to send messages to the clients – like “Shutting down. Goodbye”. When doing this on other occasions, make sure you won’t break your own protocol.
Type Definitions
- Type for the
Streamwe create when reading from the remote peer.
This type is intended to be used only for the first level ofdialog_processor_builder()s you pass to the [SocketClient] or [SocketServer], as Rust Generics isn’t able to infer a genericStreamtype in this situation (in which theStreamis created inside the generic function itself).
If your logic uses functions that receiveStreams, you’ll want flexibility to do whatever you want with theStream(which would no longer be aMutinyStream), so declare such functions as: