mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
Small fixes (#508)
* Make Shutdown public * Remove unused import * Fix documentation mistake * Fix typo
This commit is contained in:
committed by
Carl Lerche
parent
5d0d2a2e12
commit
629c9f0698
+3
-3
@@ -81,7 +81,7 @@
|
||||
//! ## Implementation
|
||||
//!
|
||||
//! The reactor implementation uses [`mio`] to interface with the operating
|
||||
//! system's event queue. A call to [`Reactor::poll`] results in in a single
|
||||
//! system's event queue. A call to [`Reactor::poll`] results in a single
|
||||
//! call to [`Poll::poll`] which in turn results in a single call to the
|
||||
//! operating system's selector.
|
||||
//!
|
||||
@@ -107,8 +107,8 @@
|
||||
//! There are a couple of ways to do this.
|
||||
//!
|
||||
//! If the custom I/O resource implements [`mio::Evented`] and implements
|
||||
//! [`std::Read`] and / or [`std::Write`], then [`PollEvented`] is the most
|
||||
//! suited.
|
||||
//! [`std::io::Read`] and / or [`std::io::Write`], then [`PollEvented`] is the
|
||||
//! most suited.
|
||||
//!
|
||||
//! Otherwise, [`Registration`] can be used directly. This provides the lowest
|
||||
//! level primitive needed for integrating with the reactor: a stream of
|
||||
|
||||
@@ -49,7 +49,7 @@ mod registration;
|
||||
|
||||
// ===== Public re-exports =====
|
||||
|
||||
pub use self::background::Background;
|
||||
pub use self::background::{Background, Shutdown};
|
||||
pub use self::registration::Registration;
|
||||
pub use self::poll_evented::PollEvented;
|
||||
|
||||
@@ -61,7 +61,7 @@ use tokio_executor::Enter;
|
||||
use tokio_executor::park::{Park, Unpark};
|
||||
|
||||
use std::{fmt, usize};
|
||||
use std::io::{self, ErrorKind};
|
||||
use std::io;
|
||||
use std::mem;
|
||||
use std::cell::RefCell;
|
||||
use std::sync::atomic::Ordering::{Relaxed, SeqCst};
|
||||
@@ -353,7 +353,6 @@ impl Reactor {
|
||||
// happened.
|
||||
match self.inner.io.poll(&mut self.events, max_wait) {
|
||||
Ok(_) => {}
|
||||
Err(ref e) if e.kind() == ErrorKind::Interrupted => return Ok(()),
|
||||
Err(e) => return Err(e),
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ use std::sync::atomic::Ordering::Relaxed;
|
||||
///
|
||||
/// This allows the caller to implement additional functions. For example,
|
||||
/// [`TcpListener`] implements poll_accept by using [`poll_read_ready`] and
|
||||
/// [`clear_write_ready`].
|
||||
/// [`clear_read_ready`].
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// pub fn poll_accept(&mut self) -> Poll<(net::TcpStream, SocketAddr), io::Error> {
|
||||
@@ -85,7 +85,7 @@ use std::sync::atomic::Ordering::Relaxed;
|
||||
/// [`Registration`]: struct.Registration.html
|
||||
/// [`TcpListener`]: ../net/struct.TcpListener.html
|
||||
/// [`clear_read_ready`]: #method.clear_read_ready
|
||||
/// [`clear_write_ready`]: #method.clear_write_ready
|
||||
/// [`clear_read_ready`]: #method.clear_read_ready
|
||||
/// [`poll_read_ready`]: #method.poll_read_ready
|
||||
/// [`poll_write_ready`]: #method.poll_write_ready
|
||||
pub struct PollEvented<E: Evented> {
|
||||
@@ -342,7 +342,7 @@ where E: Evented
|
||||
/// cannot be cleared as it is a final state.
|
||||
///
|
||||
/// After calling this function, `poll_write_ready(Ready::writable())` will
|
||||
/// return `NotReady` until a new read readiness event has been received.
|
||||
/// return `NotReady` until a new write readiness event has been received.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user