Struct mio::event::Event [−][src]
pub struct Event { /* fields omitted */ }
An readiness event returned by Poll::poll
.
Event
is a readiness state paired with a Token
. It is returned by
Poll::poll
.
For more documentation on polling and events, see Poll
.
Examples
use mio::{Ready, Token}; use mio::event::Event; let event = Event::new(Ready::readable() | Ready::writable(), Token(0)); assert_eq!(event.readiness(), Ready::readable() | Ready::writable()); assert_eq!(event.token(), Token(0));
Implementations
impl Event
[src]
impl Event
[src]pub fn new(readiness: Ready, token: Token) -> Event
[src]
Creates a new Event
containing readiness
and token
Examples
use mio::{Ready, Token}; use mio::event::Event; let event = Event::new(Ready::readable() | Ready::writable(), Token(0)); assert_eq!(event.readiness(), Ready::readable() | Ready::writable()); assert_eq!(event.token(), Token(0));
pub fn readiness(&self) -> Ready
[src]
Returns the event’s readiness.
Examples
use mio::{Ready, Token}; use mio::event::Event; let event = Event::new(Ready::readable() | Ready::writable(), Token(0)); assert_eq!(event.readiness(), Ready::readable() | Ready::writable());
pub fn token(&self) -> Token
[src]
Returns the event’s token.
Examples
use mio::{Ready, Token}; use mio::event::Event; let event = Event::new(Ready::readable() | Ready::writable(), Token(0)); assert_eq!(event.token(), Token(0));