zmq

Struct PollItem

Source
#[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>

Source

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.

Source

pub fn set_events(&mut self, events: PollEvents)

Change the events to wait for.

Source

pub fn get_revents(&self) -> PollEvents

Retrieve the events that occurred for this handle.

Source

pub fn is_readable(&self) -> bool

Returns true if the polled socket has messages ready to receive.

Source

pub fn is_writable(&self) -> bool

Returns true if the polled socket can accept messages to be sent without blocking.

Source

pub fn is_error(&self) -> bool

Returns true if the polled socket encountered an error condition.

Source

pub fn has_socket(&self, socket: &Socket) -> bool

Returns true if the polled socket is the given 0MQ socket.

Source

pub fn has_fd(&self, fd: RawFd) -> bool

Returns true if the polled socket is the given file descriptor.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.