mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
chore: fix docs links (#1523)
This commit is contained in:
committed by
Carl Lerche
parent
6369d0f4f2
commit
c0a64d67ca
@@ -5,6 +5,7 @@
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![deny(intra_doc_link_resolution_failure)]
|
||||
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
|
||||
|
||||
//! Asynchronous file and standard stream adaptation.
|
||||
|
||||
@@ -16,9 +16,7 @@ use std::task::Poll;
|
||||
|
||||
/// Returns a stream over the entries within a directory.
|
||||
///
|
||||
/// This is an async version of [`std::fs::read_dir`][std]
|
||||
///
|
||||
/// [std]: https://doc.rust-lang.org/std/fs/fn.read_dir.html
|
||||
/// This is an async version of [`std::fs::read_dir`](std::fs::read_dir)
|
||||
pub async fn read_dir<P>(path: P) -> io::Result<ReadDir>
|
||||
where
|
||||
P: AsRef<Path> + Send + 'static,
|
||||
@@ -43,8 +41,8 @@ where
|
||||
///
|
||||
/// [`read_dir`]: fn.read_dir.html
|
||||
/// [`DirEntry`]: struct.DirEntry.html
|
||||
/// [`Stream`]: ../futures/stream/trait.Stream.html
|
||||
/// [`Err`]: https://doc.rust-lang.org/std/result/enum.Result.html#variant.Err
|
||||
/// [`Stream`]: Stream
|
||||
/// [`Err`]: std::result::Result::Err
|
||||
#[derive(Debug)]
|
||||
#[must_use = "streams do nothing unless polled"]
|
||||
pub struct ReadDir(State);
|
||||
@@ -86,14 +84,12 @@ impl Stream for ReadDir {
|
||||
///
|
||||
/// [`ReadDir`]: struct.ReadDir.html
|
||||
///
|
||||
/// This is a specialized version of [`std::fs::DirEntry`][std] for usage from the
|
||||
/// This is a specialized version of [`std::fs::DirEntry`](std::fs::DirEntry) for usage from the
|
||||
/// Tokio runtime.
|
||||
///
|
||||
/// An instance of `DirEntry` represents an entry inside of a directory on the
|
||||
/// filesystem. Each entry can be inspected via methods to learn about the full
|
||||
/// path or possibly other metadata through per-platform extension traits.
|
||||
///
|
||||
/// [std]: https://doc.rust-lang.org/std/fs/struct.DirEntry.html
|
||||
#[derive(Debug)]
|
||||
pub struct DirEntry(Arc<std::fs::DirEntry>);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::path::{Path, PathBuf};
|
||||
///
|
||||
/// This is an async version of [`std::fs::read_link`][std]
|
||||
///
|
||||
/// [std]: https://doc.rust-lang.org/std/fs/fn.read_link.html
|
||||
/// [std]: std::fs::read_link
|
||||
pub async fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
|
||||
let path = path.as_ref().to_owned();
|
||||
asyncify(move || std::fs::read_link(path)).await
|
||||
|
||||
@@ -5,9 +5,7 @@ use std::path::Path;
|
||||
|
||||
/// Removes an existing, empty directory.
|
||||
///
|
||||
/// This is an async version of [`std::fs::remove_dir`][std]
|
||||
///
|
||||
/// [std]: https://doc.rust-lang.org/std/fs/fn.remove_dir.html
|
||||
/// This is an async version of [`std::fs::remove_dir`](std::fs::remove_dir)
|
||||
pub async fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
|
||||
let path = path.as_ref().to_owned();
|
||||
asyncify(move || std::fs::remove_dir(path)).await
|
||||
|
||||
@@ -8,9 +8,7 @@ use std::path::Path;
|
||||
///
|
||||
/// This will not work if the new name is on a different mount point.
|
||||
///
|
||||
/// This is an async version of [`std::fs::rename`][std]
|
||||
///
|
||||
/// [std]: https://doc.rust-lang.org/std/fs/fn.rename.html
|
||||
/// This is an async version of [`std::fs::rename`](std::fs::rename)
|
||||
pub async fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> {
|
||||
let from = from.as_ref().to_owned();
|
||||
let to = to.as_ref().to_owned();
|
||||
|
||||
Reference in New Issue
Block a user