Small fixes (#508)

* Make Shutdown public
* Remove unused import
* Fix documentation mistake
* Fix typo
This commit is contained in:
Stjepan Glavina
2018-07-30 20:46:04 -07:00
committed by Carl Lerche
parent 5d0d2a2e12
commit 629c9f0698
3 changed files with 8 additions and 9 deletions
+3 -3
View File
@@ -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
+2 -3
View File
@@ -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),
}
+3 -3
View File
@@ -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
///