Skip to content

Commit

Permalink
Remove some cross-crate links in doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eminence committed Mar 25, 2023
1 parent 894a936 commit aab323e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 38 deletions.
7 changes: 0 additions & 7 deletions procfs-core/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,6 @@ impl IntoIterator for MemoryMaps {
}

/// Represents an entry in a `/proc/<pid>/maps` or `/proc/<pid>/smaps` file.
///
/// To construct this structure for the current process, see [Process::maps()] and
/// [Process::smaps()].
#[derive(Debug, PartialEq, Eq, Clone)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct MemoryMap {
Expand Down Expand Up @@ -624,8 +621,6 @@ impl MemoryMap {
}

/// Represents the information about a specific mapping as presented in /proc/\<pid\>/smaps
///
/// To construct this structure, see [Process::smaps()]
#[derive(Default, Debug, PartialEq, Eq, Clone)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct MMapExtension {
Expand Down Expand Up @@ -683,8 +678,6 @@ impl crate::FromBufRead for Io {
}

/// Describes a file descriptor opened by a process.
///
/// See also the [Process::fd()] method.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub enum FDTarget {
Expand Down
15 changes: 0 additions & 15 deletions procfs-core/src/process/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,6 @@ pub struct MountStat {
}

/// Mount information from `/proc/<pid>/mountstats`.
///
/// # Example:
///
/// ```
/// # use procfs::process::Process;
/// let stats = Process::myself().unwrap().mountstats().unwrap();
///
/// for mount in stats {
/// println!("{} mounted on {} wth type {}",
/// mount.device.unwrap_or("??".to_owned()),
/// mount.mount_point.display(),
/// mount.fs
/// );
/// }
/// ```
#[derive(Debug, Clone)]
#[cfg_attr(test, derive(PartialEq))]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
Expand Down
2 changes: 0 additions & 2 deletions procfs-core/src/process/pagemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ impl MemoryPageFlags {
}

/// A Page Frame Number, representing a 4 kiB physical memory page
///
/// See also [crate::iomem()]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Pfn(pub u64);

Expand Down
14 changes: 6 additions & 8 deletions procfs-core/src/process/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use std::str::FromStr;

/// Status information about the process, based on the `/proc/<pid>/stat` file.
///
/// To construct one of these structures, you have to first create a [Process](crate::process::Process).
///
/// Not all fields are available in every kernel. These fields have `Option<T>` types.
///
/// New fields to this struct may be added at any time (even without a major or minor semver bump).
Expand Down Expand Up @@ -64,24 +62,24 @@ pub struct Stat {
/// The number of major faults that the process's waited-for children have made.
pub cmajflt: u64,
/// Amount of time that this process has been scheduled in user mode, measured in clock ticks
/// (divide by [`ticks_per_second()`](crate::ticks_per_second).
/// (divide by `ticks_per_second()`).
///
/// This includes guest time, guest_time (time spent running a virtual CPU, see below), so that
/// applications that are not aware of the guest time field do not lose that time from their
/// calculations.
pub utime: u64,
/// Amount of time that this process has been scheduled in kernel mode, measured in clock ticks
/// (divide by [`ticks_per_second()`](crate::ticks_per_second)).
/// (divide by `ticks_per_second()`).
pub stime: u64,

/// Amount of time that this process's waited-for children have been scheduled in
/// user mode, measured in clock ticks (divide by [`ticks_per_second()`](crate::ticks_per_second)).
/// user mode, measured in clock ticks (divide by `ticks_per_second()`).
///
/// This includes guest time, cguest_time (time spent running a virtual CPU, see below).
pub cutime: i64,

/// Amount of time that this process's waited-for children have been scheduled in kernel
/// mode, measured in clock ticks (divide by [`ticks_per_second()`](crate::ticks_per_second)).
/// mode, measured in clock ticks (divide by `ticks_per_second()`).
pub cstime: i64,
/// For processes running a real-time scheduling policy (policy below; see sched_setscheduler(2)),
/// this is the negated scheduling priority, minus one;
Expand Down Expand Up @@ -185,12 +183,12 @@ pub struct Stat {
/// (since Linux 2.6.18)
pub delayacct_blkio_ticks: Option<u64>,
/// Guest time of the process (time spent running a virtual CPU for a guest operating system),
/// measured in clock ticks (divide by [`ticks_per_second()`](crate::ticks_per_second))
/// measured in clock ticks (divide by `ticks_per_second()`)
///
/// (since Linux 2.6.24)
pub guest_time: Option<u64>,
/// Guest time of the process's children, measured in clock ticks (divide by
/// [`ticks_per_second()`](crate::ticks_per_second)).
/// `ticks_per_second()`).
///
/// (since Linux 2.6.24)
pub cguest_time: Option<i64>,
Expand Down
2 changes: 0 additions & 2 deletions procfs-core/src/process/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use serde::{Deserialize, Serialize};

/// Status information about the process, based on the `/proc/<pid>/status` file.
///
/// To construct this structure, see [Process::status()](crate::process::Process::status).
///
/// Not all fields are available in every kernel. These fields have `Option<T>` types.
/// In general, the current kernel version will tell you what fields you can expect, but this
/// isn't totally reliable, since some kernels might backport certain fields, or fields might
Expand Down
6 changes: 2 additions & 4 deletions procfs-core/src/sys/kernel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Version {
/// # Example
///
/// ```
/// # use procfs::KernelVersion;
/// # use procfs_core::KernelVersion;
/// let a = KernelVersion::from_str("3.16.0-6-amd64").unwrap();
/// let b = KernelVersion::new(3, 16, 0);
/// assert_eq!(a, b);
Expand Down Expand Up @@ -70,7 +70,7 @@ impl FromStr for Version {
/// # Example
///
/// ```
/// # use procfs::KernelVersion;
/// # use procfs_core::KernelVersion;
/// let a: KernelVersion = "3.16.0-6-amd64".parse().unwrap();
/// let b = KernelVersion::new(3, 16, 0);
/// assert_eq!(a, b);
Expand Down Expand Up @@ -294,8 +294,6 @@ bitflags! {
}

/// Values controlling functions allowed to be invoked by the SysRq key
///
/// To construct this enum, see [sysrq](crate::sys::kernel::sysrq)
#[derive(Copy, Clone, Debug)]
pub enum SysRq {
/// Disable sysrq completely
Expand Down
15 changes: 15 additions & 0 deletions procfs/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,21 @@ impl Process {
///
/// This data is taken from the `/proc/[pid]/mountinfo` file
///
/// # Example:
///
/// ```
/// # use procfs::process::Process;
/// let stats = Process::myself().unwrap().mountstats().unwrap();
///
/// for mount in stats {
/// println!("{} mounted on {} wth type {}",
/// mount.device.unwrap_or("??".to_owned()),
/// mount.mount_point.display(),
/// mount.fs
/// );
/// }
/// ```
///
/// (Since Linux 2.6.26)
pub fn mountinfo(&self) -> ProcResult<MountInfos> {
self.read("mountinfo")
Expand Down

0 comments on commit aab323e

Please sign in to comment.