[−][src]Struct gaea::Queue
User space readiness queue.
A simple, single threaded user space readiness event queue. This implements
event::Source
which can be used to poll for readiness events.
Polling this event source never returns an error.
Examples
use gaea::{Event, Queue, Ready, event, poll}; let mut queue = Queue::new(); let mut events = Vec::new(); // Add a new event. let event = Event::new(event::Id(0), Ready::READABLE); queue.add(event); // Now we poll for events. Note that this is safe to unwrap as polling // `Queue` never returns an error. poll::<_, ()>(&mut [&mut queue], &mut events, None).unwrap(); assert_eq!(events.get(0), Some(&event));
Methods
impl Queue
[src]
pub fn new() -> Queue
[src]
Create a new user space readiness event queue.
pub fn add(&mut self, event: Event)
[src]
Add a new readiness event.
Trait Implementations
impl<ES, E> Source<ES, E> for Queue where
ES: Sink,
[src]
ES: Sink,
fn max_timeout(&self) -> Option<Duration>
[src]
fn poll(&mut self, event_sink: &mut ES) -> Result<(), E>
[src]
fn blocking_poll(
&mut self,
event_sink: &mut ES,
timeout: Option<Duration>
) -> Result<(), E>
[src]
&mut self,
event_sink: &mut ES,
timeout: Option<Duration>
) -> Result<(), E>
A blocking poll for readiness events. Read more
impl Default for Queue
[src]
impl Debug for Queue
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,