Struct message_io::events::EventReceiver[][src]

pub struct EventReceiver<E> { /* fields omitted */ }

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

impl<E> EventReceiver<E> where
    E: Send + 'static, 
[src]

pub fn sender(&self) -> &EventSender<E>[src]

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.

pub fn receive(&mut self) -> E[src]

Blocks the current thread until an event is received by this queue.

pub fn receive_timeout(&mut self, timeout: Duration) -> Option<E>[src]

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.

pub fn try_receive(&mut self) -> Option<E>[src]

Attempts to receive an event without blocking. Returns Some(E) if an event was received by this queue, otherwise returns None.

Trait Implementations

impl<E> Default for EventReceiver<E> where
    E: Send + 'static, 
[src]

fn default() -> Self[src]

Creates a new event queue for generic incoming events.

Auto Trait Implementations

impl<E> RefUnwindSafe for EventReceiver<E> where
    E: RefUnwindSafe

impl<E> Send for EventReceiver<E> where
    E: Send

impl<E> Sync for EventReceiver<E> where
    E: Send + Sync

impl<E> Unpin for EventReceiver<E> where
    E: Unpin

impl<E> UnwindSafe for EventReceiver<E> where
    E: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,