#[repr(C)]pub struct PollItem<'a> { /* private fields */ }
Expand description
Represents a handle that can be poll()
ed.
This is either a reference to a 0MQ socket, or a standard socket.
Apart from that it contains the requested event mask, and is updated
with the occurred events after poll()
finishes.
Implementations§
source§impl<'a> PollItem<'a>
impl<'a> PollItem<'a>
sourcepub fn from_fd(fd: RawFd) -> PollItem<'a>
pub fn from_fd(fd: RawFd) -> PollItem<'a>
Construct a PollItem from a non-0MQ socket, given by its file descriptor.
sourcepub fn set_events(&mut self, events: PollEvents)
pub fn set_events(&mut self, events: PollEvents)
Change the events to wait for.
sourcepub fn get_revents(&self) -> PollEvents
pub fn get_revents(&self) -> PollEvents
Retrieve the events that occurred for this handle.
sourcepub fn is_readable(&self) -> bool
pub fn is_readable(&self) -> bool
Returns true if the polled socket has messages ready to receive.
sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Returns true if the polled socket can accept messages to be sent without blocking.