Rename feature docs.rs to docs

integrate-threads-example
Stjepan Glavina 5 years ago
parent 756da0e89d
commit 9d8ac36813

@ -12,11 +12,11 @@ keywords = []
categories = ["asynchronous", "concurrency"]
[package.metadata.docs.rs]
features = ["docs.rs"]
rustdoc-args = ["--features docs.rs"]
features = ["docs"]
rustdoc-args = ["--features docs"]
[features]
"docs.rs" = []
docs = []
[dependencies]
async-task = { path = "async-task" }

@ -25,7 +25,7 @@ git clone git@github.com:stjepang/async-std.git && cd async-std
Read the docs:
```
cargo doc --features docs.rs --open
cargo doc --features docs --open
```
Check out the [examples](examples). To run an example:

@ -102,16 +102,16 @@ impl DirBuilder {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::fs::DirBuilderExt;
} else if #[cfg(unix)] {
use std::os::unix::fs::DirBuilderExt;
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl DirBuilderExt for DirBuilder {
fn mode(&mut self, mode: u32) -> &mut Self {
self.mode = Some(mode);

@ -228,16 +228,16 @@ fn io_error(err: impl Into<Box<dyn std::error::Error + Send + Sync>>) -> io::Err
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::fs::DirEntryExt;
} else if #[cfg(unix)] {
use std::os::unix::fs::DirEntryExt;
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl DirEntryExt for DirEntry {
fn ino(&self) -> u64 {
self.ino

@ -772,7 +772,7 @@ impl From<std::fs::File> for File {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -782,9 +782,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for File {
fn as_raw_fd(&self) -> RawFd {
self.raw_fd
@ -805,9 +805,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(windows)))]
#[cfg_attr(feature = "docs", doc(cfg(windows)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
impl AsRawHandle for File {
fn as_raw_handle(&self) -> RawHandle {
self.raw_handle.0

@ -333,16 +333,16 @@ impl OpenOptions {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::fs::OpenOptionsExt;
} else if #[cfg(unix)] {
use std::os::unix::fs::OpenOptionsExt;
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl OpenOptionsExt for OpenOptions {
fn mode(&mut self, mode: u32) -> &mut Self {
self.0.mode(mode);

@ -10,7 +10,7 @@ use crate::future::Future;
use crate::task::{Context, Poll};
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
#[doc(hidden)]
pub struct ImplFuture<'a, T>(std::marker::PhantomData<&'a T>);
@ -33,7 +33,7 @@ cfg_if! {
///
/// [`std::io::BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
/// [`futures::io::AsyncBufRead`]:
/// https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncBufRead.html
/// https://docs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncBufRead.html
pub trait BufRead {
/// Reads all bytes into `buf` until the delimiter `byte` or EOF is reached.
///

@ -11,7 +11,7 @@ use crate::io;
use crate::task::{Context, Poll};
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
#[doc(hidden)]
pub struct ImplFuture<'a, T>(std::marker::PhantomData<&'a T>);
@ -34,7 +34,7 @@ cfg_if! {
///
/// [`std::io::Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
/// [`futures::io::AsyncRead`]:
/// https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncRead.html
/// https://docs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncRead.html
pub trait Read {
/// Reads some bytes from the byte stream.
///

@ -9,7 +9,7 @@ use crate::io;
use crate::task::{Context, Poll};
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
#[doc(hidden)]
pub struct ImplFuture<'a, T>(std::marker::PhantomData<&'a T>);
@ -32,7 +32,7 @@ cfg_if! {
///
/// [`std::io::Seek`]: https://doc.rust-lang.org/std/io/trait.Seek.html
/// [`futures::io::AsyncSeek`]:
/// https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncSeek.html
/// https://docs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncSeek.html
pub trait Seek {
/// Seeks to a new position in a byte stream.
///

@ -163,7 +163,7 @@ impl futures::io::AsyncWrite for Stderr {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, RawFd};
use crate::os::windows::io::{AsRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -173,9 +173,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for Stderr {
fn as_raw_fd(&self) -> RawFd {
io::stderr().as_raw_fd()
@ -184,9 +184,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
impl AsRawHandle for Stderr {
fn as_raw_handle(&self) -> RawHandle {
io::stderr().as_raw_handle()

@ -195,7 +195,7 @@ impl futures::io::AsyncRead for Stdin {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, RawFd};
use crate::os::windows::io::{AsRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -205,9 +205,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for Stdin {
fn as_raw_fd(&self) -> RawFd {
io::stdin().as_raw_fd()
@ -216,9 +216,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
impl AsRawHandle for Stdin {
fn as_raw_handle(&self) -> RawHandle {
io::stdin().as_raw_handle()

@ -163,7 +163,7 @@ impl futures::io::AsyncWrite for Stdout {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, RawFd};
use crate::os::windows::io::{AsRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -173,9 +173,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for Stdout {
fn as_raw_fd(&self) -> RawFd {
io::stdout().as_raw_fd()
@ -184,9 +184,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
impl AsRawHandle for Stdout {
fn as_raw_handle(&self) -> RawHandle {
io::stdout().as_raw_handle()

@ -10,7 +10,7 @@ use crate::io;
use crate::task::{Context, Poll};
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
#[doc(hidden)]
pub struct ImplFuture<'a, T>(std::marker::PhantomData<&'a T>);
@ -33,7 +33,7 @@ cfg_if! {
///
/// [`std::io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
/// [`futures::io::AsyncWrite`]:
/// https://docs.rs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncWrite.html
/// https://docs/futures-preview/0.3.0-alpha.17/futures/io/trait.AsyncWrite.html
pub trait Write {
/// Writes some bytes into the byte stream.
///

@ -20,7 +20,7 @@
//! ```
#![feature(async_await)]
#![cfg_attr(feature = "docs.rs", feature(doc_cfg))]
#![cfg_attr(feature = "docs", feature(doc_cfg))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]

@ -260,7 +260,7 @@ impl From<net::TcpListener> for TcpListener {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
// use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -270,9 +270,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for TcpListener {
fn as_raw_fd(&self) -> RawFd {
self.raw_fd
@ -293,9 +293,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(windows)))]
#[cfg_attr(feature = "docs", doc(cfg(windows)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
// impl AsRawSocket for TcpListener {
// fn as_raw_socket(&self) -> RawSocket {
// self.raw_socket

@ -24,9 +24,9 @@ use crate::task::{Context, Poll};
/// [`connect`]: struct.TcpStream.html#method.connect
/// [accepting]: struct.TcpListener.html#method.accept
/// [listener]: struct.TcpListener.html
/// [`AsyncRead`]: https://docs.rs/futures-preview/0.3.0-alpha.13/futures/io/trait.AsyncRead.html
/// [`AsyncWrite`]: https://docs.rs/futures-preview/0.3.0-alpha.13/futures/io/trait.AsyncRead.html
/// [`futures::io`]: https://docs.rs/futures-preview/0.3.0-alpha.13/futures/io
/// [`AsyncRead`]: https://docs/futures-preview/0.3.0-alpha.13/futures/io/trait.AsyncRead.html
/// [`AsyncWrite`]: https://docs/futures-preview/0.3.0-alpha.13/futures/io/trait.AsyncRead.html
/// [`futures::io`]: https://docs/futures-preview/0.3.0-alpha.13/futures/io
/// [`shutdown`]: struct.TcpStream.html#method.shutdown
/// [`std::net::TcpStream`]: https://doc.rust-lang.org/std/net/struct.TcpStream.html
///
@ -463,7 +463,7 @@ impl From<net::TcpStream> for TcpStream {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
// use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -473,9 +473,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for TcpStream {
fn as_raw_fd(&self) -> RawFd {
self.raw_fd
@ -496,9 +496,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(windows)))]
#[cfg_attr(feature = "docs", doc(cfg(windows)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
// impl AsRawSocket for TcpStream {
// fn as_raw_socket(&self) -> RawSocket {
// self.raw_socket

@ -537,7 +537,7 @@ impl From<net::UdpSocket> for UdpSocket {
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
// use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
} else if #[cfg(unix)] {
@ -547,9 +547,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
cfg_if! {
if #[cfg(any(unix, feature = "docs.rs"))] {
if #[cfg(any(unix, feature = "docs"))] {
impl AsRawFd for UdpSocket {
fn as_raw_fd(&self) -> RawFd {
self.raw_fd
@ -570,9 +570,9 @@ cfg_if! {
}
}
#[cfg_attr(feature = "docs.rs", doc(cfg(windows)))]
#[cfg_attr(feature = "docs", doc(cfg(windows)))]
cfg_if! {
if #[cfg(any(windows, feature = "docs.rs"))] {
if #[cfg(any(windows, feature = "docs"))] {
// use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket};
//
// impl AsRawSocket for UdpSocket {

@ -1,9 +1,9 @@
//! OS-specific extensions.
#[cfg(any(unix, feature = "docs.rs"))]
#[cfg_attr(feature = "docs.rs", doc(cfg(unix)))]
#[cfg(any(unix, feature = "docs"))]
#[cfg_attr(feature = "docs", doc(cfg(unix)))]
pub mod unix;
#[cfg(any(windows, feature = "docs.rs"))]
#[cfg_attr(feature = "docs.rs", doc(cfg(windows)))]
#[cfg(any(windows, feature = "docs"))]
#[cfg_attr(feature = "docs", doc(cfg(windows)))]
pub mod windows;

@ -34,7 +34,7 @@ pub async fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Resu
}
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
/// Unix-specific extensions to `DirBuilder`.
pub trait DirBuilderExt {
/// Sets the mode to create new directories with. This option defaults to

@ -3,7 +3,7 @@
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
/// Raw file descriptors.
pub type RawFd = std::os::raw::c_int;

@ -43,14 +43,14 @@ use crate::task::{blocking, Poll};
/// # Ok(()) }) }
/// ```
pub struct UnixDatagram {
#[cfg(not(feature = "docs.rs"))]
#[cfg(not(feature = "docs"))]
io_handle: IoHandle<mio_uds::UnixDatagram>,
raw_fd: RawFd,
}
impl UnixDatagram {
#[cfg(not(feature = "docs.rs"))]
#[cfg(not(feature = "docs"))]
fn new(socket: mio_uds::UnixDatagram) -> UnixDatagram {
UnixDatagram {
raw_fd: socket.as_raw_fd(),

@ -50,7 +50,7 @@ use crate::task::{blocking, Context, Poll};
/// # Ok(()) }) }
/// ```
pub struct UnixListener {
#[cfg(not(feature = "docs.rs"))]
#[cfg(not(feature = "docs"))]
io_handle: IoHandle<mio_uds::UnixListener>,
raw_fd: RawFd,

@ -11,7 +11,7 @@ mod listener;
mod stream;
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
use std::fmt;
use std::path::Path;

@ -40,7 +40,7 @@ use crate::task::{blocking, Context, Poll};
/// # Ok(()) }) }
/// ```
pub struct UnixStream {
#[cfg(not(feature = "docs.rs"))]
#[cfg(not(feature = "docs"))]
pub(super) io_handle: IoHandle<mio_uds::UnixStream>,
pub(super) raw_fd: RawFd,

@ -3,7 +3,7 @@
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
/// Raw HANDLEs.
pub type RawHandle = *mut std::os::raw::c_void;

@ -29,7 +29,7 @@ use crate::future::Future;
use crate::task::{Context, Poll};
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
#[doc(hidden)]
pub struct ImplFuture<'a, T>(std::marker::PhantomData<&'a T>);
@ -52,7 +52,7 @@ cfg_if! {
///
/// [`std::iter::Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html
/// [`futures::stream::Stream`]:
/// https://docs.rs/futures-preview/0.3.0-alpha.17/futures/stream/trait.Stream.html
/// https://docs/futures-preview/0.3.0-alpha.17/futures/stream/trait.Stream.html
pub trait Stream {
/// The type of items yielded by this stream.
type Item;

@ -40,7 +40,7 @@ use crate::io;
use crate::task::{Context, Poll};
cfg_if! {
if #[cfg(feature = "docs.rs")] {
if #[cfg(feature = "docs")] {
#[doc(hidden)]
pub struct ImplFuture<T>(std::marker::PhantomData<T>);

Loading…
Cancel
Save