Struct message_io::events::EventReceiver [−][src]
pub struct EventReceiver<E> { /* fields omitted */ }
Expand description
A generic and synchronized queue where the user can send and receive events.
See EventSender
to see how send events.
This entity can be used as an utility for the crate::network
module redirecting the
network events to process them later from here.
Implementations
Returns the internal sender reference to this queue. This reference can be safety cloned and shared to other threads in order to get several senders to the same queue.
Blocks the current thread until an event is received by this queue.
Blocks the current thread until an event is received by this queue or timeout is exceeded. If timeout is reached a None is returned, otherwise the event is returned.
Attempts to receive an event without blocking. Returns Some(E) if an event was received by this queue, otherwise returns None.