pub struct EpollEventType(/* private fields */);
Expand description
Epoll 事件类型(类似 poll 的事件掩码)
Implementations§
Source§impl EpollEventType
impl EpollEventType
Sourcepub const EPOLLRDNORM: Self
pub const EPOLLRDNORM: Self
普通数据可读(normal read)
Sourcepub const EPOLLRDBAND: Self
pub const EPOLLRDBAND: Self
带外数据可读(band read)
Sourcepub const EPOLLWRNORM: Self
pub const EPOLLWRNORM: Self
普通数据可写(normal write)
Sourcepub const EPOLLWRBAND: Self
pub const EPOLLWRBAND: Self
带外数据可写(band write)
Sourcepub const EPOLLRDHUP: Self
pub const EPOLLRDHUP: Self
流被对端关闭,半关闭状态(对端调用 shutdown 写)
Sourcepub const EPOLLEXCLUSIVE: Self
pub const EPOLLEXCLUSIVE: Self
表示该监听是排他的(exclusive),用于防止多线程同时触发
Sourcepub const EPOLLWAKEUP: Self
pub const EPOLLWAKEUP: Self
唤醒系统 suspend 状态(需要 CAP_BLOCK_SUSPEND 权限)
Sourcepub const EPOLLONESHOT: Self
pub const EPOLLONESHOT: Self
事件触发一次后就自动删除(one-shot 模式)
Source§impl EpollEventType
impl EpollEventType
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> Self
pub const fn from_bits_retain(bits: u32) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl EpollEventType
impl EpollEventType
Sourcepub const fn iter(&self) -> Iter<EpollEventType>
pub const fn iter(&self) -> Iter<EpollEventType>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<EpollEventType>
pub const fn iter_names(&self) -> IterNames<EpollEventType>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for EpollEventType
impl Binary for EpollEventType
Source§impl BitAnd for EpollEventType
impl BitAnd for EpollEventType
Source§impl BitAndAssign for EpollEventType
impl BitAndAssign for EpollEventType
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOr for EpollEventType
impl BitOr for EpollEventType
Source§fn bitor(self, other: EpollEventType) -> Self
fn bitor(self, other: EpollEventType) -> Self
The bitwise or (|
) of the bits in two flags values.
Source§type Output = EpollEventType
type Output = EpollEventType
|
operator.Source§impl BitOrAssign for EpollEventType
impl BitOrAssign for EpollEventType
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXor for EpollEventType
impl BitXor for EpollEventType
Source§impl BitXorAssign for EpollEventType
impl BitXorAssign for EpollEventType
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Clone for EpollEventType
impl Clone for EpollEventType
Source§fn clone(&self) -> EpollEventType
fn clone(&self) -> EpollEventType
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EpollEventType
impl Debug for EpollEventType
Source§impl Extend<EpollEventType> for EpollEventType
impl Extend<EpollEventType> for EpollEventType
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Flags for EpollEventType
impl Flags for EpollEventType
Source§const FLAGS: &'static [Flag<EpollEventType>]
const FLAGS: &'static [Flag<EpollEventType>]
Source§fn from_bits_retain(bits: u32) -> EpollEventType
fn from_bits_retain(bits: u32) -> EpollEventType
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<EpollEventType> for EpollEventType
impl FromIterator<EpollEventType> for EpollEventType
Source§impl IntoIterator for EpollEventType
impl IntoIterator for EpollEventType
Source§impl LowerHex for EpollEventType
impl LowerHex for EpollEventType
Source§impl Not for EpollEventType
impl Not for EpollEventType
Source§impl Octal for EpollEventType
impl Octal for EpollEventType
Source§impl PublicFlags for EpollEventType
impl PublicFlags for EpollEventType
Source§impl Sub for EpollEventType
impl Sub for EpollEventType
Source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§type Output = EpollEventType
type Output = EpollEventType
-
operator.Source§impl SubAssign for EpollEventType
impl SubAssign for EpollEventType
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Auto Trait Implementations§
impl Freeze for EpollEventType
impl RefUnwindSafe for EpollEventType
impl Send for EpollEventType
impl Sync for EpollEventType
impl Unpin for EpollEventType
impl UnwindSafe for EpollEventType
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
clone_to_uninit
)