Enum message_io::node::NodeEvent
source · pub enum NodeEvent<'a, S> {
Network(NetEvent<'a>),
Signal(S),
}Expand description
Event returned by NodeListener::for_each() and NodeListener::for_each_async()
when some network event or signal is received.
Variants§
Network(NetEvent<'a>)
The NodeEvent is an event that comes from the network.
See NetEvent to know about the different network events.
Signal(S)
The NodeEvent is a signal.
A signal is an event produced by the own node to itself.
You can send signals with timers or priority.
See EventSender to know about how to send signals.
Implementations§
source§impl<'a, S> NodeEvent<'a, S>
impl<'a, S> NodeEvent<'a, S>
sourcepub fn network(self) -> NetEvent<'a>
pub fn network(self) -> NetEvent<'a>
Assume the event is a NodeEvent::Network, panics if not.
sourcepub fn signal(self) -> S
pub fn signal(self) -> S
Assume the event is a NodeEvent::Signal, panics if not.