Skip to main content

SelectFlags

Struct SelectFlags 

Source
#[repr(transparent)]
pub struct SelectFlags(pub c_int);
Expand description

Mode flags for select. Combine with |.

For example SelectFlags::READ | SelectFlags::CUSTOM_MSG. Defined in erl_drv_nif.h; each flag carries its own introduction version, as the cancel, custom-message, and error modes were added after the base ones.

ErlNifSelectFlags — NIF 2.12 — OTP 20

Tuple Fields§

§0: c_int

Implementations§

Source§

impl SelectFlags

Source

pub const READ: Self

Select for read readiness.

ERL_NIF_SELECT_READ — NIF 2.12 — OTP 20

Source

pub const WRITE: Self

Select for write readiness.

ERL_NIF_SELECT_WRITE — NIF 2.12 — OTP 20

Source

pub const STOP: Self

Stop selecting on the event and trigger the resource stop callback.

The safe way to retire an OS event before closing it: any active read/write selections are cancelled first, then the resource’s stop callback is called — directly or scheduled — once no notification can still be in flight. The event must not be closed until that callback has run. pid and ref are ignored.

ERL_NIF_SELECT_STOP — NIF 2.12 — OTP 20

Source

pub const CANCEL: Self

Cancel a pending read or write select without stopping.

Combine with SelectFlags::READ and/or SelectFlags::WRITE to choose which selections to cancel; pid and ref are ignored. The return value’s *_CANCELLED bits report whether each was actually removed or whether a notification may already have been sent.

ERL_NIF_SELECT_CANCEL — NIF 2.15 — OTP 22

Source

pub const CUSTOM_MSG: Self

Deliver msg as a custom message instead of the default select message.

ERL_NIF_SELECT_CUSTOM_MSG — NIF 2.15 — OTP 22

Source

pub const ERROR: Self

Select for error conditions on the event.

ERL_NIF_SELECT_ERROR — NIF 2.16 — OTP 24

Trait Implementations§

Source§

impl BitOr for SelectFlags

Source§

type Output = SelectFlags

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl Clone for SelectFlags

Source§

fn clone(&self) -> SelectFlags

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SelectFlags

Source§

impl Eq for SelectFlags

Source§

impl PartialEq for SelectFlags

Source§

fn eq(&self, other: &SelectFlags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SelectFlags

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.