pub enum Output<Msg: UserMsgPayload> {
Show 14 variants
Handshake {
peer: PeerID,
event: HandshakeOutput,
},
InitOpenOffer,
OfferReady(SignalingPayload),
AnswerReady(SignalingPayload),
SendMessage {
peer_to: PeerID,
data: MsgPayload<Msg>,
},
ReceiveMessage {
peer_from: PeerID,
data: MsgPayload<Msg>,
},
PeerConnected {
peer: PeerID,
},
PeerDisconnected {
peer: PeerID,
},
PeerLost {
peer: PeerID,
},
Connected,
Available,
Unavailable,
Disconnecting,
ScheduleTimer {
kind: Scheduled,
after_ms: u64,
},
}Expand description
Common event that client FSM sends
Variants§
Handshake
Handshake event for a known peer
InitOpenOffer
Bootstrap host: create an open offer (joiner peer ID not yet known)
OfferReady(SignalingPayload)
Bootstrap host: open offer SDP is ready to be shared out-of-band with a joiner
AnswerReady(SignalingPayload)
Bootstrap joiner: SDP answer is ready to be shared out-of-band with the host
SendMessage
Send message to other peer in mesh
ReceiveMessage
Initiate receiving message from any outer sender
PeerConnected
Notify about new peer connected to mesh
PeerDisconnected
Notify about peer that gracefully left the mesh
PeerLost
Notify about peer lost due to connection failure (abrupt, candidate for reconnect)
Connected
Node-level status: first peer reached Connected (FSMState: Init → Connected).
Available
Node-level status: all relay handshakes complete (FSMState: Connected → Available).
Node-level status: a relay handshake is in progress or no peers are connected (FSMState: Available → Connected, or any → Init).
Disconnecting
Local node sent disconnect notices to all peers; driver must close all connections (FSMState: anything → Left).
ScheduleTimer
Driver should schedule a timer