mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
docs: fix all rustdoc warnings (#1474)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user