pub enum ConnectionEvent<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, LocalPeerMessages: 'static + Send + Sync + PartialEq + Debug + ReactiveMessagingSerializer<LocalPeerMessages>> {
PeerConnected {
peer: Arc<Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>>,
},
PeerDisconnected {
peer: Arc<Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>>,
stream_stats: Arc<StreamExecutor>,
},
ApplicationShutdown {
timeout_ms: u32,
},
}
Expand description
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 the Peer
objects 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.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, LocalPeerMessages> !RefUnwindSafe for ConnectionEvent<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, LocalPeerMessages> Send for ConnectionEvent<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, LocalPeerMessages> Sync for ConnectionEvent<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, LocalPeerMessages> Unpin for ConnectionEvent<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, LocalPeerMessages> !UnwindSafe for ConnectionEvent<BUFFERED_MESSAGES_PER_PEER_COUNT, LocalPeerMessages>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more