Switch to intra-doc links in std::process
This commit is contained in:
parent
873fc463bd
commit
e005b71125
1 changed files with 37 additions and 58 deletions
|
@ -84,25 +84,15 @@
|
||||||
//! assert_eq!(b"test", output.stdout.as_slice());
|
//! assert_eq!(b"test", output.stdout.as_slice());
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! [`abort`]: fn.abort.html
|
//! [`spawn`]: Command::spawn
|
||||||
//! [`exit`]: fn.exit.html
|
//! [`output`]: Command::output
|
||||||
//!
|
//!
|
||||||
//! [`Command`]: struct.Command.html
|
//! [`stdout`]: Command::stdout
|
||||||
//! [`spawn`]: struct.Command.html#method.spawn
|
//! [`stdin`]: Command::stdin
|
||||||
//! [`output`]: struct.Command.html#method.output
|
//! [`stderr`]: Command::stderr
|
||||||
//!
|
//!
|
||||||
//! [`Child`]: struct.Child.html
|
//! [`Write`]: io::Write
|
||||||
//! [`ChildStdin`]: struct.ChildStdin.html
|
//! [`Read`]: io::Read
|
||||||
//! [`ChildStdout`]: struct.ChildStdout.html
|
|
||||||
//! [`ChildStderr`]: struct.ChildStderr.html
|
|
||||||
//! [`Stdio`]: struct.Stdio.html
|
|
||||||
//!
|
|
||||||
//! [`stdout`]: struct.Command.html#method.stdout
|
|
||||||
//! [`stdin`]: struct.Command.html#method.stdin
|
|
||||||
//! [`stderr`]: struct.Command.html#method.stderr
|
|
||||||
//!
|
|
||||||
//! [`Write`]: ../io/trait.Write.html
|
|
||||||
//! [`Read`]: ../io/trait.Read.html
|
|
||||||
|
|
||||||
#![stable(feature = "process", since = "1.0.0")]
|
#![stable(feature = "process", since = "1.0.0")]
|
||||||
|
|
||||||
|
@ -130,7 +120,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
|
||||||
/// run, even after the `Child` handle to the child process has gone out of
|
/// run, even after the `Child` handle to the child process has gone out of
|
||||||
/// scope.
|
/// scope.
|
||||||
///
|
///
|
||||||
/// Calling [`wait`](#method.wait) (or other functions that wrap around it) will make
|
/// Calling [`wait`] (or other functions that wrap around it) will make
|
||||||
/// the parent process wait until the child has actually exited before
|
/// the parent process wait until the child has actually exited before
|
||||||
/// continuing.
|
/// continuing.
|
||||||
///
|
///
|
||||||
|
@ -162,9 +152,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
|
||||||
/// assert!(ecode.success());
|
/// assert!(ecode.success());
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Command`]: struct.Command.html
|
/// [`wait`]: Child::wait
|
||||||
/// [`Drop`]: ../../core/ops/trait.Drop.html
|
|
||||||
/// [`wait`]: #method.wait
|
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct Child {
|
pub struct Child {
|
||||||
handle: imp::Process,
|
handle: imp::Process,
|
||||||
|
@ -227,9 +215,8 @@ impl fmt::Debug for Child {
|
||||||
/// file handle will be closed. If the child process was blocked on input prior
|
/// file handle will be closed. If the child process was blocked on input prior
|
||||||
/// to being dropped, it will become unblocked after dropping.
|
/// to being dropped, it will become unblocked after dropping.
|
||||||
///
|
///
|
||||||
/// [`Child`]: struct.Child.html
|
/// [`stdin`]: crate::process::Child.stdin
|
||||||
/// [`stdin`]: struct.Child.html#structfield.stdin
|
/// [dropped]: Drop
|
||||||
/// [dropped]: ../ops/trait.Drop.html
|
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct ChildStdin {
|
pub struct ChildStdin {
|
||||||
inner: AnonPipe,
|
inner: AnonPipe,
|
||||||
|
@ -286,9 +273,8 @@ impl fmt::Debug for ChildStdin {
|
||||||
/// When an instance of `ChildStdout` is [dropped], the `ChildStdout`'s
|
/// When an instance of `ChildStdout` is [dropped], the `ChildStdout`'s
|
||||||
/// underlying file handle will be closed.
|
/// underlying file handle will be closed.
|
||||||
///
|
///
|
||||||
/// [`Child`]: struct.Child.html
|
/// [`stdout`]: crate::process::Child.stdout
|
||||||
/// [`stdout`]: struct.Child.html#structfield.stdout
|
/// [dropped]: Drop
|
||||||
/// [dropped]: ../ops/trait.Drop.html
|
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct ChildStdout {
|
pub struct ChildStdout {
|
||||||
inner: AnonPipe,
|
inner: AnonPipe,
|
||||||
|
@ -347,9 +333,8 @@ impl fmt::Debug for ChildStdout {
|
||||||
/// When an instance of `ChildStderr` is [dropped], the `ChildStderr`'s
|
/// When an instance of `ChildStderr` is [dropped], the `ChildStderr`'s
|
||||||
/// underlying file handle will be closed.
|
/// underlying file handle will be closed.
|
||||||
///
|
///
|
||||||
/// [`Child`]: struct.Child.html
|
/// [`stderr`]: crate::process::Child.stderr
|
||||||
/// [`stderr`]: struct.Child.html#structfield.stderr
|
/// [dropped]: Drop
|
||||||
/// [dropped]: ../ops/trait.Drop.html
|
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct ChildStderr {
|
pub struct ChildStderr {
|
||||||
inner: AnonPipe,
|
inner: AnonPipe,
|
||||||
|
@ -522,7 +507,7 @@ impl Command {
|
||||||
///
|
///
|
||||||
/// To pass multiple arguments see [`args`].
|
/// To pass multiple arguments see [`args`].
|
||||||
///
|
///
|
||||||
/// [`args`]: #method.args
|
/// [`args`]: Command::args
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -547,7 +532,7 @@ impl Command {
|
||||||
///
|
///
|
||||||
/// To pass a single argument see [`arg`].
|
/// To pass a single argument see [`arg`].
|
||||||
///
|
///
|
||||||
/// [`arg`]: #method.arg
|
/// [`arg`]: Command::arg
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -700,7 +685,7 @@ impl Command {
|
||||||
/// .expect("ls command failed to start");
|
/// .expect("ls command failed to start");
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`canonicalize`]: ../fs/fn.canonicalize.html
|
/// [`canonicalize`]: crate::fs::canonicalize
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Command {
|
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Command {
|
||||||
self.inner.cwd(dir.as_ref().as_ref());
|
self.inner.cwd(dir.as_ref().as_ref());
|
||||||
|
@ -712,8 +697,8 @@ impl Command {
|
||||||
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
|
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
|
||||||
/// defaults to [`piped`] when used with `output`.
|
/// defaults to [`piped`] when used with `output`.
|
||||||
///
|
///
|
||||||
/// [`inherit`]: struct.Stdio.html#method.inherit
|
/// [`inherit`]: Stdio::inherit
|
||||||
/// [`piped`]: struct.Stdio.html#method.piped
|
/// [`piped`]: Stdio::piped
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -738,8 +723,8 @@ impl Command {
|
||||||
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
|
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
|
||||||
/// defaults to [`piped`] when used with `output`.
|
/// defaults to [`piped`] when used with `output`.
|
||||||
///
|
///
|
||||||
/// [`inherit`]: struct.Stdio.html#method.inherit
|
/// [`inherit`]: Stdio::inherit
|
||||||
/// [`piped`]: struct.Stdio.html#method.piped
|
/// [`piped`]: Stdio::piped
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -764,8 +749,8 @@ impl Command {
|
||||||
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
|
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
|
||||||
/// defaults to [`piped`] when used with `output`.
|
/// defaults to [`piped`] when used with `output`.
|
||||||
///
|
///
|
||||||
/// [`inherit`]: struct.Stdio.html#method.inherit
|
/// [`inherit`]: Stdio::inherit
|
||||||
/// [`piped`]: struct.Stdio.html#method.piped
|
/// [`piped`]: Stdio::piped
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -893,10 +878,8 @@ impl AsInnerMut<imp::Command> for Command {
|
||||||
/// [`Command`], or the [`wait_with_output`] method of a [`Child`]
|
/// [`Command`], or the [`wait_with_output`] method of a [`Child`]
|
||||||
/// process.
|
/// process.
|
||||||
///
|
///
|
||||||
/// [`Command`]: struct.Command.html
|
/// [`output`]: Command::output
|
||||||
/// [`Child`]: struct.Child.html
|
/// [`wait_with_output`]: Child::wait_with_output
|
||||||
/// [`output`]: struct.Command.html#method.output
|
|
||||||
/// [`wait_with_output`]: struct.Child.html#method.wait_with_output
|
|
||||||
#[derive(PartialEq, Eq, Clone)]
|
#[derive(PartialEq, Eq, Clone)]
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct Output {
|
pub struct Output {
|
||||||
|
@ -939,10 +922,9 @@ impl fmt::Debug for Output {
|
||||||
/// Describes what to do with a standard I/O stream for a child process when
|
/// Describes what to do with a standard I/O stream for a child process when
|
||||||
/// passed to the [`stdin`], [`stdout`], and [`stderr`] methods of [`Command`].
|
/// passed to the [`stdin`], [`stdout`], and [`stderr`] methods of [`Command`].
|
||||||
///
|
///
|
||||||
/// [`stdin`]: struct.Command.html#method.stdin
|
/// [`stdin`]: Command::stdin
|
||||||
/// [`stdout`]: struct.Command.html#method.stdout
|
/// [`stdout`]: Command::stdout
|
||||||
/// [`stderr`]: struct.Command.html#method.stderr
|
/// [`stderr`]: Command::stderr
|
||||||
/// [`Command`]: struct.Command.html
|
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct Stdio(imp::Stdio);
|
pub struct Stdio(imp::Stdio);
|
||||||
|
|
||||||
|
@ -1206,10 +1188,8 @@ impl From<fs::File> for Stdio {
|
||||||
/// status is exposed through the [`status`] method, or the [`wait`] method
|
/// status is exposed through the [`status`] method, or the [`wait`] method
|
||||||
/// of a [`Child`] process.
|
/// of a [`Child`] process.
|
||||||
///
|
///
|
||||||
/// [`Command`]: struct.Command.html
|
/// [`status`]: Command::status
|
||||||
/// [`Child`]: struct.Child.html
|
/// [`wait`]: Child::wait
|
||||||
/// [`status`]: struct.Command.html#method.status
|
|
||||||
/// [`wait`]: struct.Child.html#method.wait
|
|
||||||
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
|
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub struct ExitStatus(imp::ExitStatus);
|
pub struct ExitStatus(imp::ExitStatus);
|
||||||
|
@ -1294,8 +1274,8 @@ impl fmt::Display for ExitStatus {
|
||||||
/// For the platform's canonical successful and unsuccessful codes, see
|
/// For the platform's canonical successful and unsuccessful codes, see
|
||||||
/// the [`SUCCESS`] and [`FAILURE`] associated items.
|
/// the [`SUCCESS`] and [`FAILURE`] associated items.
|
||||||
///
|
///
|
||||||
/// [`SUCCESS`]: #associatedconstant.SUCCESS
|
/// [`SUCCESS`]: ExitCode::SUCCESS
|
||||||
/// [`FAILURE`]: #associatedconstant.FAILURE
|
/// [`FAILURE`]: ExitCode::FAILURE
|
||||||
///
|
///
|
||||||
/// **Warning**: While various forms of this were discussed in [RFC #1937],
|
/// **Warning**: While various forms of this were discussed in [RFC #1937],
|
||||||
/// it was ultimately cut from that RFC, and thus this type is more subject
|
/// it was ultimately cut from that RFC, and thus this type is more subject
|
||||||
|
@ -1349,9 +1329,9 @@ impl Child {
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`ErrorKind`]: ../io/enum.ErrorKind.html
|
/// [`ErrorKind`]: io::ErrorKind
|
||||||
/// [`InvalidInput`]: ../io/enum.ErrorKind.html#variant.InvalidInput
|
/// [`InvalidInput`]: io::ErrorKind::InvalidInput
|
||||||
/// [`Other`]: ../io/enum.ErrorKind.html#variant.Other
|
/// [`Other`]: io::ErrorKind::Other
|
||||||
#[stable(feature = "process", since = "1.0.0")]
|
#[stable(feature = "process", since = "1.0.0")]
|
||||||
pub fn kill(&mut self) -> io::Result<()> {
|
pub fn kill(&mut self) -> io::Result<()> {
|
||||||
self.handle.kill()
|
self.handle.kill()
|
||||||
|
@ -1616,8 +1596,7 @@ pub fn exit(code: i32) -> ! {
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`panic!`]: ../../std/macro.panic.html
|
/// [panic hook]: crate::panic::set_hook
|
||||||
/// [panic hook]: ../../std/panic/fn.set_hook.html
|
|
||||||
#[stable(feature = "process_abort", since = "1.17.0")]
|
#[stable(feature = "process_abort", since = "1.17.0")]
|
||||||
pub fn abort() -> ! {
|
pub fn abort() -> ! {
|
||||||
crate::sys::abort_internal();
|
crate::sys::abort_internal();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue