docs: fix all rustdoc warnings (#1474)

This commit is contained in:
Ivan Petkov
2019-08-18 14:38:54 -07:00
committed by Carl Lerche
parent 08b07afbd9
commit 68d5fcb8d1
27 changed files with 69 additions and 100 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ pub trait AsyncRead {
///
/// This function is called from [`poll_read_buf`].
///
/// [`io::Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
/// [`io::Read`]: std::io::Read
/// [`poll_read_buf`]: #method.poll_read_buf
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [u8]) -> bool {
for x in buf {
-3
View File
@@ -22,9 +22,6 @@ use std::{cmp, fmt};
/// When the `BufReader` is dropped, the contents of its buffer will be
/// discarded. Creating multiple instances of a `BufReader` on the same
/// stream can cause data loss.
///
/// [`AsyncRead`]: tokio_io::AsyncRead
///
// TODO: Examples
pub struct BufReader<R> {
inner: R,
+1 -1
View File
@@ -24,7 +24,7 @@ use std::task::{Context, Poll};
/// stream can cause data loss. If you need to write out the contents of its
/// buffer, you must manually call flush before the writer is dropped.
///
/// [`AsyncWrite`]: tokio_io::AsyncWrite
/// [`AsyncWrite`]: AsyncWrite
/// [`flush`]: super::AsyncWriteExt::flush
///
// TODO: Examples
-2
View File
@@ -7,8 +7,6 @@ use std::task::{Context, Poll};
/// A future used to fully flush an I/O object.
///
/// Created by the [`AsyncWriteExt::flush`] function.
///
/// [`flush`]: fn.flush.html
#[derive(Debug)]
pub struct Flush<'a, A: ?Sized> {
a: &'a mut A,
-38
View File
@@ -1,41 +1,3 @@
//! Asynchronous I/O.
//!
//! This module is the asynchronous version of `std::io`. Primarily, it
//! defines two traits, [`AsyncRead`] and [`AsyncWrite`], which extend the
//! `Read` and `Write` traits of the standard library.
//!
//! # AsyncRead and AsyncWrite
//!
//! [`AsyncRead`] and [`AsyncWrite`] must only be implemented for
//! non-blocking I/O types that integrate with the futures type system. In
//! other words, these types must never block the thread, and instead the
//! current task is notified when the I/O resource is ready.
//!
//! # Standard input and output
//!
//! Tokio provides asynchronous APIs to standard [input], [output], and [error].
//! These APIs are very similar to the ones provided by `std`, but they also
//! implement [`AsyncRead`] and [`AsyncWrite`].
//!
//! Unlike *most* other Tokio APIs, the standard input / output APIs
//! **must** be used from the context of the Tokio runtime as they require
//! Tokio specific features to function.
//!
//! [input]: fn.stdin.html
//! [output]: fn.stdout.html
//! [error]: fn.stderr.html
//!
//! # `std` re-exports
//!
//! Additionally, [`Error`], [`ErrorKind`], and [`Result`] are re-exported
//! from `std::io` for ease of use.
//!
//! [`AsyncRead`]: trait.AsyncRead.html
//! [`AsyncWrite`]: trait.AsyncWrite.html
//! [`Error`]: struct.Error.html
//! [`ErrorKind`]: enum.ErrorKind.html
//! [`Result`]: type.Result.html
mod async_buf_read_ext;
mod async_read_ext;
mod async_write_ext;
+1 -3
View File
@@ -9,9 +9,7 @@ use std::task::{Context, Poll};
/// A future which can be used to easily read exactly enough bytes to fill
/// a buffer.
///
/// Created by the [`read_exact`] function.
///
/// [`read_exact`]: fn.read_exact.html
/// Created by the [`AsyncRead::read_exact`].
pub(crate) fn read_exact<'a, A>(reader: &'a mut A, buf: &'a mut [u8]) -> ReadExact<'a, A>
where
A: AsyncRead + Unpin + ?Sized,
-2
View File
@@ -7,8 +7,6 @@ use std::task::{Context, Poll};
/// A future used to shutdown an I/O object.
///
/// Created by the [`AsyncWriteExt::shutdown`] function.
///
/// [`shutdown`]: fn.shutdown.html
#[derive(Debug)]
pub struct Shutdown<'a, A: ?Sized> {
a: &'a mut A,