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.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> RefUnwindSafe for NodeEvent<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for NodeEvent<'a, S>where
S: Send,
impl<'a, S> Sync for NodeEvent<'a, S>where
S: Sync,
impl<'a, S> Unpin for NodeEvent<'a, S>where
S: Unpin,
impl<'a, S> UnwindSafe for NodeEvent<'a, S>where
S: UnwindSafe,
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