pub struct Interest {
pub readable: bool,
pub writable: bool,
pub priority: bool,
pub oneshot: bool,
pub edge: bool,
}Expand description
Interest types for file descriptor registration 文件描述符注册的兴趣类型
Specifies which events the driver should monitor for a file descriptor. 指定driver应监控文件描述符的哪些事件。
Fields§
§readable: boolMonitor for readability / 监控可读性
writable: boolMonitor for writability / 监控可写性
priority: boolPriority hint for edge-triggered mode / 边缘触发模式的优先级提示
oneshot: boolOne-shot mode: auto-deregister after one event / 单次模式:事件后自动取消注册
edge: boolEdge-triggered mode vs level-triggered / 边缘触发模式 vs 水平触发
Implementations§
Source§impl Interest
impl Interest
Sourcepub const fn with_readable(self) -> Self
pub const fn with_readable(self) -> Self
Add readability to the interest 添加可读性到兴趣
Sourcepub const fn with_writable(self) -> Self
pub const fn with_writable(self) -> Self
Add writability to the interest 添加可写性到兴趣
Sourcepub const fn with_priority(self) -> Self
pub const fn with_priority(self) -> Self
Enable priority mode 启用优先级模式
Sourcepub const fn with_oneshot(self) -> Self
pub const fn with_oneshot(self) -> Self
Enable one-shot mode 启用单次模式
Sourcepub const fn to_epoll_flags(self) -> u32
Available on Linux only.
pub const fn to_epoll_flags(self) -> u32
Convert to epoll event flags 转换为epoll事件标志
Sourcepub fn from_epoll_flags(flags: u32) -> Self
Available on Linux only.
pub fn from_epoll_flags(flags: u32) -> Self
Convert from epoll event flags 从epoll事件标志转换
Trait Implementations§
impl Copy for Interest
impl Eq for Interest
impl StructuralPartialEq for Interest
Auto Trait Implementations§
impl Freeze for Interest
impl RefUnwindSafe for Interest
impl Send for Interest
impl Sync for Interest
impl Unpin for Interest
impl UnsafeUnpin for Interest
impl UnwindSafe for Interest
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