diff --git a/procfs-core/src/process/mod.rs b/procfs-core/src/process/mod.rs index 23045b23..0716a766 100644 --- a/procfs-core/src/process/mod.rs +++ b/procfs-core/src/process/mod.rs @@ -576,9 +576,6 @@ impl IntoIterator for MemoryMaps { } /// Represents an entry in a `/proc//maps` or `/proc//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 { @@ -624,8 +621,6 @@ impl MemoryMap { } /// Represents the information about a specific mapping as presented in /proc/\/smaps -/// -/// To construct this structure, see [Process::smaps()] #[derive(Default, Debug, PartialEq, Eq, Clone)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct MMapExtension { @@ -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 { diff --git a/procfs-core/src/process/mount.rs b/procfs-core/src/process/mount.rs index d58330b1..41531dc4 100644 --- a/procfs-core/src/process/mount.rs +++ b/procfs-core/src/process/mount.rs @@ -226,21 +226,6 @@ pub struct MountStat { } /// Mount information from `/proc//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))] diff --git a/procfs-core/src/process/pagemap.rs b/procfs-core/src/process/pagemap.rs index dcef6c0b..047ef7ee 100644 --- a/procfs-core/src/process/pagemap.rs +++ b/procfs-core/src/process/pagemap.rs @@ -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); diff --git a/procfs-core/src/process/stat.rs b/procfs-core/src/process/stat.rs index 40ec289f..79179220 100644 --- a/procfs-core/src/process/stat.rs +++ b/procfs-core/src/process/stat.rs @@ -9,8 +9,6 @@ use std::str::FromStr; /// Status information about the process, based on the `/proc//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` types. /// /// New fields to this struct may be added at any time (even without a major or minor semver bump). @@ -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; @@ -185,12 +183,12 @@ pub struct Stat { /// (since Linux 2.6.18) pub delayacct_blkio_ticks: Option, /// 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, /// 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, diff --git a/procfs-core/src/process/status.rs b/procfs-core/src/process/status.rs index a189face..43db5a69 100644 --- a/procfs-core/src/process/status.rs +++ b/procfs-core/src/process/status.rs @@ -7,8 +7,6 @@ use serde::{Deserialize, Serialize}; /// Status information about the process, based on the `/proc//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` 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 diff --git a/procfs-core/src/sys/kernel/mod.rs b/procfs-core/src/sys/kernel/mod.rs index 19a58a22..4c63c08a 100644 --- a/procfs-core/src/sys/kernel/mod.rs +++ b/procfs-core/src/sys/kernel/mod.rs @@ -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); @@ -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); @@ -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 diff --git a/procfs/src/process/mod.rs b/procfs/src/process/mod.rs index 2e60eae2..34c08de1 100644 --- a/procfs/src/process/mod.rs +++ b/procfs/src/process/mod.rs @@ -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 { self.read("mountinfo")