Struct message_io::events::EventQueue [−][src]
It's a generic and synchronized queue where the user can send events.
The user must be read these events in order to dispatch actions.
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> EventQueue<E> where
E: Send + 'static,
[src]
E: Send + 'static,
pub fn new() -> EventQueue<E>
[src]
Creates a new event queue for generic incoming events.
pub fn sender(&mut self) -> &mut 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.
Trait Implementations
Auto Trait Implementations
impl<E> RefUnwindSafe for EventQueue<E> where
E: RefUnwindSafe,
[src]
E: RefUnwindSafe,
impl<E> Send for EventQueue<E> where
E: Send,
[src]
E: Send,
impl<E> Sync for EventQueue<E> where
E: Send + Sync,
[src]
E: Send + Sync,
impl<E> Unpin for EventQueue<E> where
E: Unpin,
[src]
E: Unpin,
impl<E> UnwindSafe for EventQueue<E> where
E: RefUnwindSafe,
[src]
E: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,