[][src]Struct eventum::EventManager

pub struct EventManager { /* fields omitted */ }

Event Manager.

Implementations

impl EventManager[src]

pub fn new() -> EventManager[src]

Constructor.

pub fn register_low(&self, handler: Arc<dyn EventHandler>)[src]

Register a low priority event.

pub fn register_high(&self, handler: Arc<dyn EventHandler>)[src]

Register a high priority event.

pub fn poll_low(&self) -> Vec<(EventType, Arc<dyn EventHandler>)>[src]

Poll low priority events.

pub fn poll_high(&self) -> Vec<(EventType, Arc<dyn EventHandler>)>[src]

Poll high priority events.

pub fn register_listen(
    &self,
    fd: &mut dyn Source,
    handler: Arc<dyn EventHandler>
) -> Result<(), EventError>
[src]

Register listen socket.

pub fn register_read_write(
    &self,
    fd: &mut dyn Source,
    handler: Arc<dyn EventHandler>
) -> Result<(), EventError>
[src]

Register read/write socket. Typically socket is bidirectional.

pub fn register_read(
    &self,
    fd: &mut dyn Source,
    handler: Arc<dyn EventHandler>
) -> Result<(), EventError>
[src]

Register read socket.

pub fn register_write(
    &self,
    fd: &mut dyn Source,
    handler: Arc<dyn EventHandler>
) -> Result<(), EventError>
[src]

Register write socket.

pub fn unregister_read(&self, fd: &mut dyn Source, token: Token)[src]

Unregister read socket.

pub fn poll_get_events(&self) -> Events[src]

Poll and return events ready to read or write.

pub fn poll_get_handler(&self, event: &Event) -> Option<Arc<dyn EventHandler>>[src]

Return handler associated with token.

pub fn poll_fd(&self) -> Vec<(EventType, Arc<dyn EventHandler>)>[src]

Poll FDs and handle events.

pub fn register_timer(&self, d: Duration, handler: Arc<dyn EventHandler>)[src]

Register timer.

pub fn poll_timer(&self) -> Vec<(EventType, Arc<dyn EventHandler>)>[src]

Poll timers and handle events.

pub fn register_channel(&self, handler: Box<dyn ChannelHandler>)[src]

Register channel handler.

pub fn poll_channel(&self) -> Vec<(EventType, Arc<dyn EventHandler>)>[src]

Poll channel handlers.

pub fn poll(&self) -> Vec<(EventType, Arc<dyn EventHandler>)>[src]

Poll and collect all runnable events. To dispatch and do handling depends on a runner.

Auto Trait Implementations

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, 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.