use crate::sys::platform::fs::MetadataExt as UnixMetadataExt;
use crate::sys_common::{AsInner, AsInnerMut, FromInner};
-/// Unix-specific extensions to [`File`].
-///
-/// [`File`]: ../../../../std/fs/struct.File.html
+/// Unix-specific extensions to [`fs::File`].
#[stable(feature = "file_offset", since = "1.15.0")]
pub trait FileExt {
/// Reads a number of bytes starting from a given offset.
///
/// The current file cursor is not affected by this function.
///
- /// Similar to [`Read::read_exact`] but uses [`read_at`] instead of `read`.
+ /// Similar to [`io::Read::read_exact`] but uses [`read_at`] instead of `read`.
///
- /// [`Read::read_exact`]: ../../../../std/io/trait.Read.html#method.read_exact
- /// [`read_at`]: #tymethod.read_at
+ /// [`read_at`]: FileExt::read_at
///
/// # Errors
///
/// If this function encounters an error of the kind
- /// [`ErrorKind::Interrupted`] then the error is ignored and the operation
+ /// [`io::ErrorKind::Interrupted`] then the error is ignored and the operation
/// will continue.
///
/// If this function encounters an "end of file" before completely filling
- /// the buffer, it returns an error of the kind [`ErrorKind::UnexpectedEof`].
+ /// the buffer, it returns an error of the kind [`io::ErrorKind::UnexpectedEof`].
/// The contents of `buf` are unspecified in this case.
///
/// If any other read error is encountered then this function immediately
/// has read, but it will never read more than would be necessary to
/// completely fill the buffer.
///
- /// [`ErrorKind::Interrupted`]: ../../../../std/io/enum.ErrorKind.html#variant.Interrupted
- /// [`ErrorKind::UnexpectedEof`]: ../../../../std/io/enum.ErrorKind.html#variant.UnexpectedEof
- ///
/// # Examples
///
/// ```no_run
/// The current file cursor is not affected by this function.
///
/// This method will continuously call [`write_at`] until there is no more data
- /// to be written or an error of non-[`ErrorKind::Interrupted`] kind is
+ /// to be written or an error of non-[`io::ErrorKind::Interrupted`] kind is
/// returned. This method will not return until the entire buffer has been
/// successfully written or such an error occurs. The first error that is
- /// not of [`ErrorKind::Interrupted`] kind generated from this method will be
+ /// not of [`io::ErrorKind::Interrupted`] kind generated from this method will be
/// returned.
///
/// # Errors
///
/// This function will return the first error of
- /// non-[`ErrorKind::Interrupted`] kind that [`write_at`] returns.
+ /// non-[`io::ErrorKind::Interrupted`] kind that [`write_at`] returns.
///
- /// [`ErrorKind::Interrupted`]: ../../../../std/io/enum.ErrorKind.html#variant.Interrupted
- /// [`write_at`]: #tymethod.write_at
+ /// [`write_at`]: FileExt::write_at
///
/// # Examples
///
}
/// Unix-specific extensions to [`fs::Permissions`].
-///
-/// [`fs::Permissions`]: ../../../../std/fs/struct.Permissions.html
#[stable(feature = "fs_ext", since = "1.1.0")]
pub trait PermissionsExt {
/// Returns the underlying raw `st_mode` bits that contain the standard
}
/// Unix-specific extensions to [`fs::OpenOptions`].
-///
-/// [`fs::OpenOptions`]: ../../../../std/fs/struct.OpenOptions.html
#[stable(feature = "fs_ext", since = "1.1.0")]
pub trait OpenOptionsExt {
/// Sets the mode bits that a new file will be created with.
}
/// Unix-specific extensions to [`fs::Metadata`].
-///
-/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
/// Returns the ID of the device containing the file.
fn atime(&self) -> i64;
/// Returns the last access time of the file, in nanoseconds since [`atime`].
///
- /// [`atime`]: #tymethod.atime
+ /// [`atime`]: MetadataExt::atime
///
/// # Examples
///
fn mtime(&self) -> i64;
/// Returns the last modification time of the file, in nanoseconds since [`mtime`].
///
- /// [`mtime`]: #tymethod.mtime
+ /// [`mtime`]: MetadataExt::mtime
///
/// # Examples
///
fn ctime(&self) -> i64;
/// Returns the last status change time of the file, in nanoseconds since [`ctime`].
///
- /// [`ctime`]: #tymethod.ctime
+ /// [`ctime`]: MetadataExt::ctime
///
/// # Examples
///
}
}
-/// Unix-specific extensions for [`FileType`].
+/// Unix-specific extensions for [`fs::FileType`].
///
/// Adds support for special Unix file types such as block/character devices,
/// pipes, and sockets.
-///
-/// [`FileType`]: ../../../../std/fs/struct.FileType.html
#[stable(feature = "file_type_ext", since = "1.5.0")]
pub trait FileTypeExt {
/// Returns `true` if this file type is a block device.
}
/// Unix-specific extension methods for [`fs::DirEntry`].
-///
-/// [`fs::DirEntry`]: ../../../../std/fs/struct.DirEntry.html
#[stable(feature = "dir_entry_ext", since = "1.1.0")]
pub trait DirEntryExt {
/// Returns the underlying `d_ino` field in the contained `dirent`
}
/// Unix-specific extensions to [`fs::DirBuilder`].
-///
-/// [`fs::DirBuilder`]: ../../../../std/fs/struct.DirBuilder.html
#[stable(feature = "dir_builder", since = "1.6.0")]
pub trait DirBuilderExt {
/// Sets the mode to create new directories with. This option defaults to
/// indefinitely. An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method.
///
- /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
- /// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
- /// [`read`]: ../../../../std/io/trait.Read.html#tymethod.read
- /// [`Duration`]: ../../../../std/time/struct.Duration.html
+ /// [`None`]: crate::option::Option::None
+ /// [`Err`]: crate::result::Result::Err
+ /// [`read`]: io::Read::read
///
/// # Examples
///
/// indefinitely. An [`Err`] is returned if the zero [`Duration`] is
/// passed to this method.
///
- /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
- /// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
- /// [`write`]: ../../../../std/io/trait.Write.html#tymethod.write
- /// [`Duration`]: ../../../../std/time/struct.Duration.html
+ /// [`None`]: crate::option::Option::None
+ /// [`Err`]: crate::result::Result::Err
+ /// [`read`]: io::Read::read
///
/// # Examples
///
/// specified portions to immediately return with an appropriate value
/// (see the documentation of [`Shutdown`]).
///
- /// [`Shutdown`]: ../../../../std/net/enum.Shutdown.html
- ///
/// # Examples
///
/// ```no_run
/// is established. When established, the corresponding [`UnixStream`] and
/// the remote peer's address will be returned.
///
- /// [`UnixStream`]: ../../../../std/os/unix/net/struct.UnixStream.html
+ /// [`UnixStream`]: crate::os::unix::net::UnixStream
///
/// # Examples
///
/// Ok(())
/// }
/// ```
- ///
- /// [`io::ErrorKind::WouldBlock`]: ../../../io/enum.ErrorKind.html#variant.WouldBlock
#[stable(feature = "unix_socket", since = "1.10.0")]
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
self.0.set_nonblocking(nonblocking)
/// The iterator will never return [`None`] and will also not yield the
/// peer's [`SocketAddr`] structure.
///
- /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
- /// [`SocketAddr`]: struct.SocketAddr.html
+ /// [`None`]: crate::option::Option::None
///
/// # Examples
///
///
/// It will never return [`None`].
///
-/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
-/// [`UnixListener`]: struct.UnixListener.html
+/// [`None`]: crate::option::Option::None
///
/// # Examples
///
/// The [`send`] method may be used to send data to the specified address.
/// [`recv`] and [`recv_from`] will only receive data from that address.
///
- /// [`send`]: #method.send
- /// [`recv`]: #method.recv
- /// [`recv_from`]: #method.recv_from
+ /// [`send`]: UnixDatagram::send
+ /// [`recv`]: UnixDatagram::recv
+ /// [`recv_from`]: UnixDatagram::recv_from
///
/// # Examples
///
///
/// The [`connect`] method will connect the socket to a peer.
///
- /// [`connect`]: #method.connect
+ /// [`connect`]: UnixDatagram::connect
///
/// # Examples
///
/// block indefinitely. An [`Err`] is returned if the zero [`Duration`]
/// is passed to this method.
///
- /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
- /// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
- /// [`recv`]: #method.recv
- /// [`recv_from`]: #method.recv_from
- /// [`Duration`]: ../../../../std/time/struct.Duration.html
+ /// [`None`]: crate::option::Option::None
+ /// [`Err`]: crate::result::Result::Err
+ /// [`recv`]: UnixDatagram::recv
+ /// [`recv_from`]: UnixDatagram::recv_from
///
/// # Examples
///
/// block indefinitely. An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method.
///
- /// [`None`]: ../../../../std/option/enum.Option.html#variant.None
- /// [`send`]: #method.send
- /// [`send_to`]: #method.send_to
- /// [`Duration`]: ../../../../std/time/struct.Duration.html
+ /// [`None`]: crate::option::Option::None
+ /// [`send`]: UnixDatagram::send
+ /// [`send_to`]: UnixDatagram::send_to
///
/// # Examples
///
/// specified portions to immediately return with an appropriate value
/// (see the documentation of [`Shutdown`]).
///
- /// [`Shutdown`]: ../../../../std/net/enum.Shutdown.html
- ///
/// ```no_run
/// use std::os::unix::net::UnixDatagram;
/// use std::net::Shutdown;
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
/// Unix-specific extensions to the [`process::Command`] builder.
-///
-/// [`process::Command`]: ../../../../std/process/struct.Command.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait CommandExt {
/// Sets the child process's user ID. This translates to a
/// This method is stable and usable, but it should be unsafe. To fix
/// that, it got deprecated in favor of the unsafe [`pre_exec`].
///
- /// [`pre_exec`]: #tymethod.pre_exec
+ /// [`pre_exec`]: CommandExt::pre_exec
#[stable(feature = "process_exec", since = "1.15.0")]
#[rustc_deprecated(since = "1.37.0", reason = "should be unsafe, use `pre_exec` instead")]
fn before_exec<F>(&mut self, f: F) -> &mut process::Command
/// a new child. Like spawn, however, the default behavior for the stdio
/// descriptors will be to inherited from the current process.
///
- /// [`process::exit`]: ../../../process/fn.exit.html
- ///
/// # Notes
///
/// The process may be in a "broken state" if this function returns in
}
/// Unix-specific extensions to [`process::ExitStatus`].
-///
-/// [`process::ExitStatus`]: ../../../../std/process/struct.ExitStatus.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait ExitStatusExt {
/// Creates a new `ExitStatus` from the raw underlying `i32` return value of
#[allow(deprecated)]
pub type RawPthread = pthread_t;
-/// Unix-specific extensions to [`thread::JoinHandle`].
-///
-/// [`thread::JoinHandle`]: ../../../../std/thread/struct.JoinHandle.html
+/// Unix-specific extensions to [`JoinHandle`].
#[stable(feature = "thread_extensions", since = "1.9.0")]
pub trait JoinHandleExt {
/// Extracts the raw pthread_t without taking ownership