Struct PollRequest

Source
#[repr(C)]
pub struct PollRequest<'a> { /* private fields */ }
Expand description

A request for events related to a particular file descriptor in a call to poll.

Implementations§

Source§

impl<'a> PollRequest<'a>

Source

pub const fn new<'f: 'a>(file: &'f File) -> Self

Begin constructing a PollRequest that describes events to request for the given file to use in a subsequent call to poll.

The the given file must outlive the returned poll request.

Source

pub unsafe fn events_raw(self, bitmask: c_short) -> Self

Directly set the events bitmask for this request.

Safety: The given bitmask must be a valid value for the events field of struct pollfd in the kernel’s C API.

Source

pub unsafe fn or_events_raw(self, bitmask: c_short) -> Self

Merge the given events bitmask with the existing event bits in the object using the bitwise OR operation.

Safety: The given bitmask must be a valid value for the events field of struct pollfd in the kernel’s C API.

Source

pub fn response(&self) -> PollResponse

Returns the result written by the latest call to poll that included this poll request object. If poll hasn’t yet been called then the response indicates that no events have occurred.

Auto Trait Implementations§

§

impl<'a> !Freeze for PollRequest<'a>

§

impl<'a> !RefUnwindSafe for PollRequest<'a>

§

impl<'a> Send for PollRequest<'a>

§

impl<'a> !Sync for PollRequest<'a>

§

impl<'a> Unpin for PollRequest<'a>

§

impl<'a> UnwindSafe for PollRequest<'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.