pub enum Event {
ServerConnected {
server_key: Vec<u8>,
},
PeerConnected {
peer_key: Vec<u8>,
},
BinaryMessage {
peer_key: Vec<u8>,
message: Vec<u8>,
session_id: Option<SessionId>,
},
JsonMessage {
peer_key: Vec<u8>,
message: JsonMessage,
session_id: Option<SessionId>,
},
MeetingCreated(MeetingState),
MeetingReady(MeetingState),
SessionCreated(SessionState),
SessionReady(SessionState),
SessionActive(SessionState),
SessionTimeout(SessionId),
SessionFinished(SessionId),
Close,
}
Expand description
Events dispatched by the event loop stream.
Variants§
ServerConnected
Event dispatched when a handshake with the server is completed.
PeerConnected
Event dispatched when a handshake with a peer has been completed.
BinaryMessage
Binary message received from a peer.
Fields
JsonMessage
JSON message received from a peer.
Fields
message: JsonMessage
JSON message.
MeetingCreated(MeetingState)
Event dispatched when a meeting has been created.
MeetingReady(MeetingState)
Event dispatched when a meeting is ready.
A meeting is ready when the limit for the meeting point has been reached.
SessionCreated(SessionState)
Event dispatched when a session has been created.
SessionReady(SessionState)
Event dispatched when a session is ready.
A session is ready when all participants have completed the server handshake.
Peers can now handshake with each other.
SessionActive(SessionState)
Event dispatched when a session is active.
A session is active when all the participants have connected to each other.
SessionTimeout(SessionId)
Event dispatched when a session timed out waiting for all the participants.
SessionFinished(SessionId)
Event dispatched when a session has been finished.
A session can only be finished when the session owner explicitly closes the session.
Close
Event dispatched when the socket is closed.