pub enum Event<Msg: UserMsgPayload> {
Connected(NoArgCallback),
UserMessage(MessageCallback<Msg>),
Disconnected(NoArgCallback),
PeerConnected(PeerCallback),
PeerDisconnected(PeerCallback),
PeerLost(PeerCallback),
Available(NoArgCallback),
Unavailable(NoArgCallback),
}Expand description
User-facing subscription — pairs an event kind with the callback to run.
Pass to Peer::subscribe to register; the returned id is what
Peer::unsubscribe consumes.
Variants§
Connected(NoArgCallback)
Local node connected to its first peer.
UserMessage(MessageCallback<Msg>)
Message arrived from a remote peer.
Disconnected(NoArgCallback)
Local node left the mesh.
PeerConnected(PeerCallback)
Remote peer joined the mesh.
PeerDisconnected(PeerCallback)
Remote peer left gracefully.
PeerLost(PeerCallback)
Remote peer dropped abruptly (reconnect will be attempted).
Available(NoArgCallback)
All in-progress relay handshakes settled — node is fully meshed.
At least one relay handshake is in progress, or no peers connected.
Auto Trait Implementations§
impl<Msg> Freeze for Event<Msg>
impl<Msg> !RefUnwindSafe for Event<Msg>
impl<Msg> Send for Event<Msg>
impl<Msg> Sync for Event<Msg>
impl<Msg> Unpin for Event<Msg>
impl<Msg> UnsafeUnpin for Event<Msg>
impl<Msg> !UnwindSafe for Event<Msg>
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