[−][src]Struct poller::epoll::Poller
定义文件 I/O 事件通知器。
Methods
impl Poller
[src]
pub fn new() -> Self
[src]
创建一个新的 I/O 事件通知器。
pub fn add(&mut self, fd: i32, events: Events) -> Result<(), SysError>
[src]
添加一个文件描述符到监视列表中。
pub fn remove(&mut self, fd: i32) -> Result<(), SysError>
[src]
将一个文件描述符从监视列表中移除。
pub fn pull_events(
&self,
timeout_ms: i32
) -> Result<Vec<(i32, Events)>, SysError>
[src]
&self,
timeout_ms: i32
) -> Result<Vec<(i32, Events)>, SysError>
拉取所有被监测到的 I/O 事件。
Examples
let mut poller = Poller::new(); poller.add(0, Events::new().with_read()); for (fd, events) in poller.pull_events(1000).unwrap().iter() { println!("Fd={}, Events={}", fd, events); }
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Poller
impl Send for Poller
impl Sync for Poller
impl Unpin for Poller
impl UnwindSafe for Poller
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,