#[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, events: PollEvents) -> PollItem<'a>
pub fn from_fd(fd: RawFd, events: PollEvents) -> PollItem<'a>
Construct a PollItem from a non-0MQ socket, given by its file descriptor and the events that should be polled.
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.
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Returns true if the polled socket encountered an error condition.
Sourcepub fn has_socket(&self, socket: &Socket) -> bool
pub fn has_socket(&self, socket: &Socket) -> bool
Returns true if the polled socket is the given 0MQ socket.
Auto Trait Implementations§
impl<'a> Freeze for PollItem<'a>
impl<'a> RefUnwindSafe for PollItem<'a>
impl<'a> !Send for PollItem<'a>
impl<'a> !Sync for PollItem<'a>
impl<'a> Unpin for PollItem<'a>
impl<'a> UnwindSafe for PollItem<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more