Repository: GuillaumeGomez/sysinfo
Pull request #1096 (2023-10-14 14:35:36)

Remove `NetworkExt`, `CpuExt`, `GroupExt` and `ComponentsExt` traits


Patch:
diff --git a/README.md b/README.md
index ec919dc..815a88b 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,7 @@ Otherwise, here is a little code sample:
 
 ```rust
 use sysinfo::{
-    Components, ComponentsExt, Disks, NetworkExt, Networks,
-    System,
+    Components, Disks, Networks, System,
 };
 
 // Please note that we use "new_all" to ensure that all list of
@@ -100,7 +99,7 @@ Please remember that to have some up-to-date information, you need to call the e
 `refresh` method. For example, for the CPU usage:
 
 ```rust,no_run
-use sysinfo::{CpuExt, System};
+use sysinfo::System;
 
 let mut sys = System::new();
 
diff --git a/benches/basic.rs b/benches/basic.rs
index 9745fa0..48fa885 100644
--- a/benches/basic.rs
+++ b/benches/basic.rs
@@ -3,7 +3,7 @@
 extern crate test;
 
 use sysinfo::get_current_pid;
-use sysinfo::{ComponentsExt, UsersExt};
+use sysinfo::UsersExt;
 
 #[bench]
 fn bench_new(b: &mut test::Bencher) {
diff --git a/examples/simple.rs b/examples/simple.rs
index 526a56a..2cedb89 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -7,10 +7,7 @@
 use std::io::{self, BufRead, Write};
 use std::str::FromStr;
 use sysinfo::Signal::*;
-use sysinfo::{
-    Components, ComponentsExt, CpuExt, Disks, NetworkExt, Networks, Pid, Signal, System, UserExt,
-    Users, UsersExt,
-};
+use sysinfo::{Components, Disks, Networks, Pid, Signal, System, UserExt, Users, UsersExt};
 
 const signals: &[Signal] = &[
     Hangup,
diff --git a/md_doc/component.md b/md_doc/component.md
deleted file mode 100644
index 618cace..0000000
--- a/md_doc/component.md
+++ /dev/null
@@ -1,16 +0,0 @@
-Struct containing a component information (temperature and name for the moment).
-
-## Linux
-
-More information can be found at [kernel.org][k].
-
-Note: these may not be present on virtual Linux systems, such as **Docker**
-or **Windows Subsystem for Linux**. These hosts do not expose this information
-and therefore `Component` elements may be missing or not as expected.
-
-[k]: https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
-
-## Windows
-
-Please note that on Windows, you need to have Administrator priviledges to get this
-information.
diff --git a/md_doc/components.md b/md_doc/components.md
deleted file mode 100644
index 7ab71b6..0000000
--- a/md_doc/components.md
+++ /dev/null
@@ -1,11 +0,0 @@
-Component interfaces.
-
-```no_run
-use sysinfo::{Components, ComponentsExt};
-
-let mut components = Components::new();
-components.refresh_list();
-for component in components.components() {
-    println!("{component:?}");
-}
-```
\ No newline at end of file
diff --git a/md_doc/cpu.md b/md_doc/cpu.md
deleted file mode 100644
index 6281e09..0000000
--- a/md_doc/cpu.md
+++ /dev/null
@@ -1,1 +0,0 @@
-Struct containing information of a CPU.
diff --git a/md_doc/network_data.md b/md_doc/network_data.md
deleted file mode 100644
index 0707949..0000000
--- a/md_doc/network_data.md
+++ /dev/null
@@ -1,1 +0,0 @@
-Contains network interface information.
diff --git a/src/c_interface.rs b/src/c_interface.rs
index 60b7632..c14e555 100644
--- a/src/c_interface.rs
+++ b/src/c_interface.rs
@@ -1,6 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{CpuExt, Disks, NetworkExt, Networks, Pid, Process, System};
+use crate::{Disks, Networks, Pid, Process, System};
 use libc::{self, c_char, c_float, c_uint, c_void, size_t};
 use std::borrow::BorrowMut;
 use std::ffi::CString;
diff --git a/src/common.rs b/src/common.rs
index 492442c..99c1ed1 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -1,8 +1,8 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::{
-    ComponentInner, Components, ComponentsExt, Cpu, GroupExt, NetworkData, NetworksInner,
-    ProcessInner, SystemInner, User, UserExt, UsersExt,
+    ComponentInner, ComponentsInner, CpuInner, NetworkDataInner, NetworksInner, ProcessInner,
+    SystemInner, User, UserExt, UsersExt,
 };
 
 use std::cmp::Ordering;
@@ -396,11 +396,11 @@ impl System {
     ///
     /// **⚠️ Important ⚠️**
     ///
-    /// Information like [`CpuExt::brand`], [`CpuExt::vendor_id`] or [`CpuExt::frequency`]
+    /// Information like [`Cpu::brand`], [`Cpu::vendor_id`] or [`Cpu::frequency`]
     /// are not set on the "global" CPU.
     ///
     /// ```no_run
-    /// use sysinfo::{CpuRefreshKind, CpuExt, RefreshKind, System};
+    /// use sysinfo::{CpuRefreshKind, RefreshKind, System};
     ///
     /// let s = System::new_with_specifics(
     ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
@@ -408,9 +408,9 @@ impl System {
     /// println!("{}%", s.global_cpu_info().cpu_usage());
     /// ```
     ///
-    /// [`CpuExt::brand`]: crate::CpuExt::brand
-    /// [`CpuExt::vendor_id`]: crate::CpuExt::vendor_id
-    /// [`CpuExt::frequency`]: crate::CpuExt::frequency
+    /// [`Cpu::brand`]: crate::Cpu::brand
+    /// [`Cpu::vendor_id`]: crate::Cpu::vendor_id
+    /// [`Cpu::frequency`]: crate::Cpu::frequency
     pub fn global_cpu_info(&self) -> &Cpu {
         self.inner.global_cpu_info()
     }
@@ -421,7 +421,7 @@ impl System {
     /// [`System::refresh_specifics`] with `cpu` enabled.
     ///
     /// ```no_run
-    /// use sysinfo::{CpuRefreshKind, CpuExt, RefreshKind, System};
+    /// use sysinfo::{CpuRefreshKind, RefreshKind, System};
     ///
     /// let s = System::new_with_specifics(
     ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
@@ -441,7 +441,7 @@ impl System {
     /// **Important**: this information is computed every time this function is called.
     ///
     /// ```no_run
-    /// use sysinfo::{CpuExt, System};
+    /// use sysinfo::System;
     ///
     /// let s = System::new();
     /// println!("{:?}", s.physical_core_count());
@@ -1411,7 +1411,7 @@ on Windows as other platforms get this information alongside the Process informa
 /// extra computation.
 ///
 /// ```
-/// use sysinfo::{CpuExt, CpuRefreshKind, System};
+/// use sysinfo::{CpuRefreshKind, System};
 ///
 /// let mut system = System::new();
 ///
@@ -1585,7 +1585,7 @@ impl Networks {
     /// Returns an iterator over the network interfaces.
     ///
     /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt, System};
+    /// use sysinfo::{Networks, System};
     ///
     /// let mut networks = Networks::new();
     /// networks.refresh_list();
@@ -1664,6 +1664,218 @@ impl<'a> Iterator for NetworksIter<'a> {
     }
 }
 
+/// Getting volume of received and transmitted data.
+///
+/// ```no_run
+/// use sysinfo::Networks;
+///
+/// let mut networks = Networks::new();
+/// networks.refresh_list();
+/// for (interface_name, network) in &networks {
+///     println!("[{interface_name}] {network:?}");
+/// }
+/// ```
+pub struct NetworkData {
+    pub(crate) inner: NetworkDataInner,
+}
+
+impl NetworkData {
+    /// Returns the number of received bytes since the last refresh.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("in: {} B", network.received());
+    /// }
+    /// ```
+    pub fn received(&self) -> u64 {
+        self.inner.received()
+    }
+
+    /// Returns the total number of received bytes.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("in: {} B", network.total_received());
+    /// }
+    /// ```
+    pub fn total_received(&self) -> u64 {
+        self.inner.total_received()
+    }
+
+    /// Returns the number of transmitted bytes since the last refresh.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("out: {} B", network.transmitted());
+    /// }
+    /// ```
+    pub fn transmitted(&self) -> u64 {
+        self.inner.transmitted()
+    }
+
+    /// Returns the total number of transmitted bytes.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("out: {} B", network.total_transmitted());
+    /// }
+    /// ```
+    pub fn total_transmitted(&self) -> u64 {
+        self.inner.total_transmitted()
+    }
+
+    /// Returns the number of incoming packets since the last refresh.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("in: {}", network.packets_received());
+    /// }
+    /// ```
+    pub fn packets_received(&self) -> u64 {
+        self.inner.packets_received()
+    }
+
+    /// Returns the total number of incoming packets.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("in: {}", network.total_packets_received());
+    /// }
+    /// ```
+    pub fn total_packets_received(&self) -> u64 {
+        self.inner.total_packets_received()
+    }
+
+    /// Returns the number of outcoming packets since the last refresh.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("out: {}", network.packets_transmitted());
+    /// }
+    /// ```
+    pub fn packets_transmitted(&self) -> u64 {
+        self.inner.packets_transmitted()
+    }
+
+    /// Returns the total number of outcoming packets.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("out: {}", network.total_packets_transmitted());
+    /// }
+    /// ```
+    pub fn total_packets_transmitted(&self) -> u64 {
+        self.inner.total_packets_transmitted()
+    }
+
+    /// Returns the number of incoming errors since the last refresh.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("in: {}", network.errors_on_received());
+    /// }
+    /// ```
+    pub fn errors_on_received(&self) -> u64 {
+        self.inner.errors_on_received()
+    }
+
+    /// Returns the total number of incoming errors.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("in: {}", network.total_errors_on_received());
+    /// }
+    /// ```
+    pub fn total_errors_on_received(&self) -> u64 {
+        self.inner.total_errors_on_received()
+    }
+
+    /// Returns the number of outcoming errors since the last refresh.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("out: {}", network.errors_on_transmitted());
+    /// }
+    /// ```
+    pub fn errors_on_transmitted(&self) -> u64 {
+        self.inner.errors_on_transmitted()
+    }
+
+    /// Returns the total number of outcoming errors.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("out: {}", network.total_errors_on_transmitted());
+    /// }
+    /// ```
+    pub fn total_errors_on_transmitted(&self) -> u64 {
+        self.inner.total_errors_on_transmitted()
+    }
+
+    /// Returns the MAC address associated to current interface.
+    ///
+    /// ```no_run
+    /// use sysinfo::Networks;
+    ///
+    /// let mut networks = Networks::new();
+    /// networks.refresh_list();
+    /// for (interface_name, network) in &networks {
+    ///     println!("MAC address: {}", network.mac_address());
+    /// }
+    /// ```
+    pub fn mac_address(&self) -> MacAddr {
+        self.inner.mac_address()
+    }
+}
+
 /// Struct containing a disk information.
 ///
 /// ```no_run
@@ -2299,7 +2511,7 @@ impl Ord for User {
 /// It is returned by [`User::groups`].
 ///
 /// ```no_run
-/// use sysinfo::{GroupExt, UserExt, Users, UsersExt};
+/// use sysinfo::{UserExt, Users, UsersExt};
 ///
 /// let mut users = Users::new();
 ///
@@ -2321,12 +2533,40 @@ pub struct Group {
     pub(crate) name: String,
 }
 
-impl GroupExt for Group {
-    fn id(&self) -> &Gid {
+impl Group {
+    /// Returns the ID of the group.
+    ///
+    /// ⚠️ This information is not set on Windows.
+    ///
+    /// ```no_run
+    /// use sysinfo::{UserExt, Users, UsersExt};
+    ///
+    /// let mut users = Users::new();
+    ///
+    /// for user in users.users() {
+    ///     for group in user.groups() {
+    ///         println!("{:?}", group.id());
+    ///     }
+    /// }
+    /// ```
+    pub fn id(&self) -> &Gid {
         &self.id
     }
 
-    fn name(&self) -> &str {
+    /// Returns the name of the group.
+    ///
+    /// ```no_run
+    /// use sysinfo::{UserExt, Users, UsersExt};
+    ///
+    /// let mut users = Users::new();
+    ///
+    /// for user in users.users() {
+    ///     for group in user.groups() {
+    ///         println!("{}", group.name());
+    ///     }
+    /// }
+    /// ```
+    pub fn name(&self) -> &str {
         &self.name
     }
 }
@@ -2532,7 +2772,7 @@ pub fn get_current_pid() -> Result<Pid, &'static str> {
 
 /// MAC address for network interface.
 ///
-/// It is returned by [`NetworkExt::mac_address`][crate::NetworkExt::mac_address].
+/// It is returned by [`NetworkData::mac_address`][crate::NetworkData::mac_address].
 #[derive(PartialEq, Eq, Copy, Clone, Debug)]
 pub struct MacAddr(pub [u8; 6]);
 
@@ -2557,10 +2797,142 @@ impl fmt::Display for MacAddr {
     }
 }
 
+/// Interacting with components.
+///
+/// ```no_run
+/// use sysinfo::Components;
+///
+/// let mut components = Components::new();
+/// components.refresh_list();
+/// for component in components.iter() {
+///     eprintln!("{component:?}");
+/// }
+/// ```
+pub struct Components {
+    pub(crate) inner: ComponentsInner,
+}
+
+impl Default for Components {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl Components {
+    /// Creates a new [`Components`][crate::Components] type.
+    ///
+    /// ```no_run
+    /// use sysinfo::Components;
+    ///
+    /// let mut components = Components::new();
+    /// components.refresh_list();
+    /// for component in components.iter() {
+    ///     eprintln!("{component:?}");
+    /// }
+    /// ```
+    pub fn new() -> Self {
+        Self {
+            inner: ComponentsInner::new(),
+        }
+    }
+
+    /// Returns the components list.
+    ///
+    /// ```no_run
+    /// use sysinfo::Components;
+    ///
+    /// let mut components = Components::new();
+    /// components.refresh_list();
+    /// for component in components.components() {
+    ///     eprintln!("{component:?}");
+    /// }
+    /// ```
+    pub fn components(&self) -> &[Component] {
+        self.inner.components()
+    }
+
+    /// Returns the components list.
+    ///
+    /// ```no_run
+    /// use sysinfo::Components;
+    ///
+    /// let mut components = Components::new();
+    /// components.refresh_list();
+    /// for component in components.components_mut() {
+    ///     component.refresh();
+    ///     eprintln!("{component:?}");
+    /// }
+    /// ```
+    pub fn components_mut(&mut self) -> &mut [Component] {
+        self.inner.components_mut()
+    }
+
+    /// Sort the components list with the provided callback.
+    ///
+    /// Internally, it is using the [`slice::sort_unstable_by`] function, so please refer to it
+    /// for implementation details.
+    ///
+    /// You can do the same without this method by calling:
+    ///
+    /// ```no_run
+    /// use sysinfo::Components;
+    ///
+    /// let mut components = Components::new();
+    /// components.refresh_list();
+    /// components.sort_by(|component1, component2| {
+    ///     component2.label().partial_cmp(component2.label()).unwrap()
+    /// });
+    /// ```
+    ///
+    /// ⚠️ If you use [`Components::refresh_list`], you will need to call this method to sort the
+    /// components again.
+    pub fn sort_by<F>(&mut self, compare: F)
+    where
+        F: FnMut(&Component, &Component) -> std::cmp::Ordering,
+    {
+        self.components_mut().sort_unstable_by(compare);
+    }
+
+    /// Refreshes the listed components' information.
+    ///
+    /// ⚠️ If a component is added or removed, this method won't take it into account. Use
+    /// [`Components::refresh_list`] instead.
+    ///
+    /// ⚠️ If you didn't call [`Components::refresh_list`] beforehand, this method will do
+    /// nothing as the component list will be empty.
+    ///
+    /// ```no_run
+    /// use sysinfo::Components;
+    ///
+    /// let mut components = Components::new();
+    /// // We get the component list.
+    /// components.refresh_list();
+    /// // We wait some time...?
+    /// components.refresh();
+    /// ```
+    pub fn refresh(&mut self) {
+        for component in self.components_mut() {
+            component.refresh();
+        }
+    }
+
+    /// The component list will be emptied then completely recomputed.
+    ///
+    /// ```no_run
+    /// use sysinfo::Components;
+    ///
+    /// let mut components = Components::new();
+    /// components.refresh_list();
+    /// ```
+    pub fn refresh_list(&mut self) {
+        self.inner.refresh_list()
+    }
+}
+
 /// Getting a component temperature information.
 ///
 /// ```no_run
-/// use sysinfo::{Components, ComponentsExt};
+/// use sysinfo::Components;
 ///
 /// let mut components = Components::new();
 /// components.refresh_list();
@@ -2580,7 +2952,7 @@ impl Component {
     /// Returns `f32::NAN` if it failed to retrieve it.
     ///
     /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
+    /// use sysinfo::Components;
     ///
     /// let mut components = Components::new();
     /// components.refresh_list();
@@ -2598,7 +2970,7 @@ impl Component {
     /// `max` value will be updated on refresh.
     ///
     /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
+    /// use sysinfo::Components;
     ///
     /// let mut components = Components::new();
     /// components.refresh_list();
@@ -2618,7 +2990,7 @@ impl Component {
     /// Returns the highest temperature before the component halts (in celsius degree).
     ///
     /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
+    /// use sysinfo::Components;
     ///
     /// let mut components = Components::new();
     /// components.refresh_list();
@@ -2637,7 +3009,7 @@ impl Component {
     /// Returns the label of the component.
     ///
     /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
+    /// use sysinfo::Components;
     ///
     /// let mut components = Components::new();
     /// components.refresh_list();
@@ -2665,7 +3037,7 @@ impl Component {
     /// Refreshes component.
     ///
     /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
+    /// use sysinfo::Components;
     ///
     /// let mut components = Components::new();
     /// components.refresh_list();
@@ -2678,6 +3050,119 @@ impl Component {
     }
 }
 
+/// Contains all the methods of the [`Cpu`][crate::Cpu] struct.
+///
+/// ```no_run
+/// use sysinfo::{System, RefreshKind, CpuRefreshKind};
+///
+/// let mut s = System::new_with_specifics(
+///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
+/// );
+///
+/// // Wait a bit because CPU usage is based on diff.
+/// std::thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL);
+/// // Refresh CPUs again.
+/// s.refresh_cpu();
+///
+/// for cpu in s.cpus() {
+///     println!("{}%", cpu.cpu_usage());
+/// }
+/// ```
+pub struct Cpu {
+    pub(crate) inner: CpuInner,
+}
+
+impl Cpu {
+    /// Returns this CPU's usage.
+    ///
+    /// Note: You'll need to refresh it at least twice (diff between the first and the second is
+    /// how CPU usage is computed) at first if you want to have a non-zero value.
+    ///
+    /// ```no_run
+    /// use sysinfo::{System, RefreshKind, CpuRefreshKind};
+    ///
+    /// let mut s = System::new_with_specifics(
+    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
+    /// );
+    ///
+    /// // Wait a bit because CPU usage is based on diff.
+    /// std::thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL);
+    /// // Refresh CPUs again.
+    /// s.refresh_cpu();
+    ///
+    /// for cpu in s.cpus() {
+    ///     println!("{}%", cpu.cpu_usage());
+    /// }
+    /// ```
+    pub fn cpu_usage(&self) -> f32 {
+        self.inner.cpu_usage()
+    }
+
+    /// Returns this CPU's name.
+    ///
+    /// ```no_run
+    /// use sysinfo::{System, RefreshKind, CpuRefreshKind};
+    ///
+    /// let s = System::new_with_specifics(
+    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
+    /// );
+    /// for cpu in s.cpus() {
+    ///     println!("{}", cpu.name());
+    /// }
+    /// ```
+    pub fn name(&self) -> &str {
+        self.inner.name()
+    }
+
+    /// Returns the CPU's vendor id.
+    ///
+    /// ```no_run
+    /// use sysinfo::{System, RefreshKind, CpuRefreshKind};
+    ///
+    /// let s = System::new_with_specifics(
+    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
+    /// );
+    /// for cpu in s.cpus() {
+    ///     println!("{}", cpu.vendor_id());
+    /// }
+    /// ```
+    pub fn vendor_id(&self) -> &str {
+        self.inner.vendor_id()
+    }
+
+    /// Returns the CPU's brand.
+    ///
+    /// ```no_run
+    /// use sysinfo::{System, RefreshKind, CpuRefreshKind};
+    ///
+    /// let s = System::new_with_specifics(
+    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
+    /// );
+    /// for cpu in s.cpus() {
+    ///     println!("{}", cpu.brand());
+    /// }
+    /// ```
+    pub fn brand(&self) -> &str {
+        self.inner.brand()
+    }
+
+    /// Returns the CPU's frequency.
+    ///
+    /// ```no_run
+    /// use sysinfo::{System, RefreshKind, CpuRefreshKind};
+    ///
+    /// let s = System::new_with_specifics(
+    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
+    /// );
+    /// for cpu in s.cpus() {
+    ///     println!("{}", cpu.frequency());
+    /// }
+    /// ```
+    pub fn frequency(&self) -> u64 {
+        self.inner.frequency()
+    }
+}
+
 #[cfg(test)]
 mod tests {
     use super::{MacAddr, ProcessStatus};
diff --git a/src/debug.rs b/src/debug.rs
index 2a3f3a3..dc3cfcc 100644
--- a/src/debug.rs
+++ b/src/debug.rs
@@ -1,8 +1,8 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::{
-    Component, Components, Cpu, CpuExt, Disk, Disks, NetworkData, NetworkExt, Networks, Process,
-    System, User, UserExt, Users,
+    Component, Components, Cpu, Disk, Disks, NetworkData, Networks, Process, System, User, UserExt,
+    Users,
 };
 
 use std::fmt;
diff --git a/src/lib.rs b/src/lib.rs
index f63de89..d86ca28 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -52,19 +52,17 @@ cfg_if::cfg_if! {
 }
 
 pub use crate::common::{
-    get_current_pid, Component, CpuRefreshKind, Disk, DiskKind, DiskUsage, Disks, Gid, Group,
-    LoadAvg, MacAddr, Networks, NetworksIter, Pid, PidExt, Process, ProcessRefreshKind,
-    ProcessStatus, RefreshKind, Signal, System, Uid, Users,
+    get_current_pid, Component, Components, Cpu, CpuRefreshKind, Disk, DiskKind, DiskUsage, Disks,
+    Gid, Group, LoadAvg, MacAddr, NetworkData, Networks, NetworksIter, Pid, PidExt, Process,
+    ProcessRefreshKind, ProcessStatus, RefreshKind, Signal, System, Uid, Users,
 };
 
 pub(crate) use crate::sys::{
-    ComponentInner, DiskInner, DisksInner, NetworksInner, ProcessInner, SystemInner,
+    ComponentInner, ComponentsInner, CpuInner, DiskInner, DisksInner, NetworkDataInner,
+    NetworksInner, ProcessInner, SystemInner,
 };
-pub use crate::sys::{
-    Components, Cpu, NetworkData, User, IS_SUPPORTED, MINIMUM_CPU_UPDATE_INTERVAL,
-    SUPPORTED_SIGNALS,
-};
-pub use crate::traits::{ComponentsExt, CpuExt, GroupExt, NetworkExt, UserExt, UsersExt};
+pub use crate::sys::{User, IS_SUPPORTED, MINIMUM_CPU_UPDATE_INTERVAL, SUPPORTED_SIGNALS};
+pub use crate::traits::{UserExt, UsersExt};
 
 #[cfg(feature = "c-interface")]
 pub use crate::c_interface::*;
diff --git a/src/network.rs b/src/network.rs
index 1aeb4a5..d7cdcec 100644
--- a/src/network.rs
+++ b/src/network.rs
@@ -11,7 +11,7 @@ pub(crate) fn refresh_networks_addresses(interfaces: &mut HashMap<String, Networ
         Ok(ifa_iterator) => {
             for (name, ifa) in ifa_iterator {
                 if let Some(interface) = interfaces.get_mut(&name) {
-                    interface.mac_addr = ifa;
+                    interface.inner.mac_addr = ifa;
                 }
             }
         }
diff --git a/src/serde.rs b/src/serde.rs
index 1f88cfd..01e0797 100644
--- a/src/serde.rs
+++ b/src/serde.rs
@@ -1,9 +1,7 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::common::PidExt;
-use crate::{
-    CpuExt, DiskKind, DiskUsage, GroupExt, MacAddr, NetworkExt, ProcessStatus, Signal, UserExt,
-};
+use crate::{DiskKind, DiskUsage, MacAddr, ProcessStatus, Signal, UserExt};
 use serde::{ser::SerializeStruct, Serialize, Serializer};
 use std::ops::Deref;
 
diff --git a/src/traits.rs b/src/traits.rs
index 6b59337..f8eea8e 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -1,403 +1,10 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::common::{Gid, MacAddr, Uid};
-use crate::{Component, Group, User};
+use crate::common::{Gid, Uid};
+use crate::{Group, User};
 
 use std::fmt::Debug;
 
-/// Contains all the methods of the [`Cpu`][crate::Cpu] struct.
-///
-/// ```no_run
-/// use sysinfo::{CpuExt, System, RefreshKind, CpuRefreshKind};
-///
-/// let mut s = System::new_with_specifics(
-///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-/// );
-///
-/// // Wait a bit because CPU usage is based on diff.
-/// std::thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL);
-/// // Refresh CPUs again.
-/// s.refresh_cpu();
-///
-/// for cpu in s.cpus() {
-///     println!("{}%", cpu.cpu_usage());
-/// }
-/// ```
-pub trait CpuExt: Debug {
-    /// Returns this CPU's usage.
-    ///
-    /// Note: You'll need to refresh it at least twice (diff between the first and the second is
-    /// how CPU usage is computed) at first if you want to have a non-zero value.
-    ///
-    /// ```no_run
-    /// use sysinfo::{CpuExt, System, RefreshKind, CpuRefreshKind};
-    ///
-    /// let mut s = System::new_with_specifics(
-    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-    /// );
-    ///
-    /// // Wait a bit because CPU usage is based on diff.
-    /// std::thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL);
-    /// // Refresh CPUs again.
-    /// s.refresh_cpu();
-    ///
-    /// for cpu in s.cpus() {
-    ///     println!("{}%", cpu.cpu_usage());
-    /// }
-    /// ```
-    fn cpu_usage(&self) -> f32;
-
-    /// Returns this CPU's name.
-    ///
-    /// ```no_run
-    /// use sysinfo::{CpuExt, System, RefreshKind, CpuRefreshKind};
-    ///
-    /// let s = System::new_with_specifics(
-    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-    /// );
-    /// for cpu in s.cpus() {
-    ///     println!("{}", cpu.name());
-    /// }
-    /// ```
-    fn name(&self) -> &str;
-
-    /// Returns the CPU's vendor id.
-    ///
-    /// ```no_run
-    /// use sysinfo::{CpuExt, System, RefreshKind, CpuRefreshKind};
-    ///
-    /// let s = System::new_with_specifics(
-    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-    /// );
-    /// for cpu in s.cpus() {
-    ///     println!("{}", cpu.vendor_id());
-    /// }
-    /// ```
-    fn vendor_id(&self) -> &str;
-
-    /// Returns the CPU's brand.
-    ///
-    /// ```no_run
-    /// use sysinfo::{CpuExt, System, RefreshKind, CpuRefreshKind};
-    ///
-    /// let s = System::new_with_specifics(
-    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-    /// );
-    /// for cpu in s.cpus() {
-    ///     println!("{}", cpu.brand());
-    /// }
-    /// ```
-    fn brand(&self) -> &str;
-
-    /// Returns the CPU's frequency.
-    ///
-    /// ```no_run
-    /// use sysinfo::{CpuExt, System, RefreshKind, CpuRefreshKind};
-    ///
-    /// let s = System::new_with_specifics(
-    ///     RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
-    /// );
-    /// for cpu in s.cpus() {
-    ///     println!("{}", cpu.frequency());
-    /// }
-    /// ```
-    fn frequency(&self) -> u64;
-}
-
-/// Getting volume of received and transmitted data.
-///
-/// ```no_run
-/// use sysinfo::{Networks, NetworkExt};
-///
-/// let mut networks = Networks::new();
-/// networks.refresh_list();
-/// for (interface_name, network) in &networks {
-///     println!("[{interface_name}] {network:?}");
-/// }
-/// ```
-pub trait NetworkExt: Debug {
-    /// Returns the number of received bytes since the last refresh.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("in: {} B", network.received());
-    /// }
-    /// ```
-    fn received(&self) -> u64;
-
-    /// Returns the total number of received bytes.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("in: {} B", network.total_received());
-    /// }
-    /// ```
-    fn total_received(&self) -> u64;
-
-    /// Returns the number of transmitted bytes since the last refresh.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("out: {} B", network.transmitted());
-    /// }
-    /// ```
-    fn transmitted(&self) -> u64;
-
-    /// Returns the total number of transmitted bytes.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("out: {} B", network.total_transmitted());
-    /// }
-    /// ```
-    fn total_transmitted(&self) -> u64;
-
-    /// Returns the number of incoming packets since the last refresh.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("in: {}", network.packets_received());
-    /// }
-    /// ```
-    fn packets_received(&self) -> u64;
-
-    /// Returns the total number of incoming packets.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("in: {}", network.total_packets_received());
-    /// }
-    /// ```
-    fn total_packets_received(&self) -> u64;
-
-    /// Returns the number of outcoming packets since the last refresh.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("out: {}", network.packets_transmitted());
-    /// }
-    /// ```
-    fn packets_transmitted(&self) -> u64;
-
-    /// Returns the total number of outcoming packets.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("out: {}", network.total_packets_transmitted());
-    /// }
-    /// ```
-    fn total_packets_transmitted(&self) -> u64;
-
-    /// Returns the number of incoming errors since the last refresh.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("in: {}", network.errors_on_received());
-    /// }
-    /// ```
-    fn errors_on_received(&self) -> u64;
-
-    /// Returns the total number of incoming errors.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("in: {}", network.total_errors_on_received());
-    /// }
-    /// ```
-    fn total_errors_on_received(&self) -> u64;
-
-    /// Returns the number of outcoming errors since the last refresh.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("out: {}", network.errors_on_transmitted());
-    /// }
-    /// ```
-    fn errors_on_transmitted(&self) -> u64;
-
-    /// Returns the total number of outcoming errors.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("out: {}", network.total_errors_on_transmitted());
-    /// }
-    /// ```
-    fn total_errors_on_transmitted(&self) -> u64;
-
-    /// Returns the MAC address associated to current interface.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Networks, NetworkExt};
-    ///
-    /// let mut networks = Networks::new();
-    /// networks.refresh_list();
-    /// for (interface_name, network) in &networks {
-    ///     println!("MAC address: {}", network.mac_address());
-    /// }
-    /// ```
-    fn mac_address(&self) -> MacAddr;
-}
-
-/// Interacting with components.
-///
-/// ```no_run
-/// use sysinfo::{Components, ComponentsExt};
-///
-/// let mut components = Components::new();
-/// components.refresh_list();
-/// for component in components.iter() {
-///     eprintln!("{component:?}");
-/// }
-/// ```
-pub trait ComponentsExt: Debug {
-    /// Creates a new [`Components`][crate::Components] type.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
-    ///
-    /// let mut components = Components::new();
-    /// components.refresh_list();
-    /// for component in components.iter() {
-    ///     eprintln!("{component:?}");
-    /// }
-    /// ```
-    fn new() -> Self;
-
-    /// Returns the components list.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
-    ///
-    /// let mut components = Components::new();
-    /// components.refresh_list();
-    /// for component in components.components() {
-    ///     eprintln!("{component:?}");
-    /// }
-    /// ```
-    fn components(&self) -> &[Component];
-
-    /// Returns the components list.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
-    ///
-    /// let mut components = Components::new();
-    /// components.refresh_list();
-    /// for component in components.components_mut() {
-    ///     component.refresh();
-    ///     eprintln!("{component:?}");
-    /// }
-    /// ```
-    fn components_mut(&mut self) -> &mut [Component];
-
-    /// Sort the components list with the provided callback.
-    ///
-    /// Internally, it is using the [`slice::sort_unstable_by`] function, so please refer to it
-    /// for implementation details.
-    ///
-    /// You can do the same without this method by calling:
-    ///
-    /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
-    ///
-    /// let mut components = Components::new();
-    /// components.refresh_list();
-    /// components.sort_by(|component1, component2| {
-    ///     component2.label().partial_cmp(component2.label()).unwrap()
-    /// });
-    /// ```
-    ///
-    /// ⚠️ If you use [`ComponentsExt::refresh_list`], you will need to call this method to sort the
-    /// components again.
-    fn sort_by<F>(&mut self, compare: F)
-    where
-        F: FnMut(&Component, &Component) -> std::cmp::Ordering,
-    {
-        self.components_mut().sort_unstable_by(compare);
-    }
-
-    /// Refreshes the listed components' information.
-    ///
-    /// ⚠️ If a component is added or removed, this method won't take it into account. Use
-    /// [`ComponentsExt::refresh_list`] instead.
-    ///
-    /// ⚠️ If you didn't call [`ComponentsExt::refresh_list`] beforehand, this method will do
-    /// nothing as the component list will be empty.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
-    ///
-    /// let mut components = Components::new();
-    /// // We get the component list.
-    /// components.refresh_list();
-    /// // We wait some time...?
-    /// components.refresh();
-    /// ```
-    fn refresh(&mut self) {
-        for component in self.components_mut() {
-            component.refresh();
-        }
-    }
-
-    /// The component list will be emptied then completely recomputed.
-    ///
-    /// ```no_run
-    /// use sysinfo::{Components, ComponentsExt};
-    ///
-    /// let mut components = Components::new();
-    /// components.refresh_list();
-    /// ```
-    fn refresh_list(&mut self);
-}
-
 /// Getting information for a user.
 ///
 /// It is returned from [`UsersExt::users`].
@@ -595,58 +202,3 @@ pub trait UsersExt: Debug {
         self.users().iter().find(|user| user.id() == user_id)
     }
 }
-
-/// Getting information for a user group.
-///
-/// It is returned from [`UserExt::groups`].
-///
-/// ```no_run
-/// use sysinfo::{GroupExt, UserExt, Users, UsersExt};
-///
-/// let mut users = Users::new();
-///
-/// for user in users.users() {
-///     println!(
-///         "user: (ID: {:?}, group ID: {:?}, name: {:?})",
-///         user.id(),
-///         user.group_id(),
-///         user.name(),
-///     );
-///     for group in user.groups() {
-///         println!("group: (ID: {:?}, name: {:?})", group.id(), group.name());
-///     }
-/// }
-/// ```
-pub trait GroupExt: Debug + PartialEq + Eq + PartialOrd + Ord {
-    /// Returns the ID of the group.
-    ///
-    /// ⚠️ This information is not set on Windows.
-    ///
-    /// ```no_run
-    /// use sysinfo::{GroupExt, UserExt, Users, UsersExt};
-    ///
-    /// let mut users = Users::new();
-    ///
-    /// for user in users.users() {
-    ///     for group in user.groups() {
-    ///         println!("{:?}", group.id());
-    ///     }
-    /// }
-    /// ```
-    fn id(&self) -> &Gid;
-
-    /// Returns the name of the group.
-    ///
-    /// ```no_run
-    /// use sysinfo::{GroupExt, UserExt, Users, UsersExt};
-    ///
-    /// let mut users = Users::new();
-    ///
-    /// for user in users.users() {
-    ///     for group in user.groups() {
-    ///         println!("{}", group.name());
-    ///     }
-    /// }
-    /// ```
-    fn name(&self) -> &str;
-}
diff --git a/src/unix/apple/app_store/component.rs b/src/unix/apple/app_store/component.rs
index effe446..5be9276 100644
--- a/src/unix/apple/app_store/component.rs
+++ b/src/unix/apple/app_store/component.rs
@@ -1,6 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
 pub(crate) struct ComponentInner;
 
@@ -24,27 +24,26 @@ impl ComponentInner {
     pub(crate) fn refresh(&mut self) {}
 }
 
-#[doc = include_str!("../../../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     components: Vec<Component>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         Self {
             components: Vec::new(),
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         // Doesn't do anything.
     }
 }
diff --git a/src/unix/apple/component.rs b/src/unix/apple/component.rs
index 7c4196e..7ebf0b9 100644
--- a/src/unix/apple/component.rs
+++ b/src/unix/apple/component.rs
@@ -1,3 +1,3 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-pub use crate::sys::inner::component::*;
+pub(crate) use crate::sys::inner::component::*;
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs
index 8185edd..ae8bfe1 100644
--- a/src/unix/apple/cpu.rs
+++ b/src/unix/apple/cpu.rs
@@ -1,7 +1,7 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::sys::utils::{get_sys_value, get_sys_value_by_name};
-use crate::{CpuExt, CpuRefreshKind};
+use crate::{Cpu, CpuRefreshKind};
 
 use libc::{c_char, c_void, host_processor_info, mach_port_t, mach_task_self};
 use std::mem;
@@ -17,13 +17,15 @@ pub(crate) struct CpusWrapper {
 impl CpusWrapper {
     pub(crate) fn new() -> Self {
         Self {
-            global_cpu: Cpu::new(
-                "0".to_owned(),
-                Arc::new(CpuData::new(std::ptr::null_mut(), 0)),
-                0,
-                String::new(),
-                String::new(),
-            ),
+            global_cpu: Cpu {
+                inner: CpuInner::new(
+                    "0".to_owned(),
+                    Arc::new(CpuData::new(std::ptr::null_mut(), 0)),
+                    0,
+                    String::new(),
+                    String::new(),
+                ),
+            },
             cpus: Vec::new(),
             got_cpu_frequency: false,
         }
@@ -39,7 +41,7 @@ impl CpusWrapper {
         if refresh_kind.frequency() && !self.got_cpu_frequency {
             let frequency = unsafe { get_cpu_frequency() };
             for proc_ in cpus.iter_mut() {
-                proc_.set_frequency(frequency);
+                proc_.inner.set_frequency(frequency);
             }
             self.got_cpu_frequency = true;
         }
@@ -49,8 +51,8 @@ impl CpusWrapper {
                 let mut offset = 0;
                 for proc_ in cpus.iter_mut() {
                     let cpu_usage = compute_usage_of_cpu(proc_, cpu_info, offset);
-                    proc_.update(cpu_usage, Arc::clone(&proc_data));
-                    percentage += proc_.cpu_usage();
+                    proc_.inner.update(cpu_usage, Arc::clone(&proc_data));
+                    percentage += proc_.inner.cpu_usage();
 
                     offset += libc::CPU_STATE_MAX as isize;
                 }
@@ -103,8 +105,7 @@ impl Drop for CpuData {
     }
 }
 
-#[doc = include_str!("../../../md_doc/cpu.md")]
-pub struct Cpu {
+pub(crate) struct CpuInner {
     name: String,
     cpu_usage: f32,
     cpu_data: Arc<CpuData>,
@@ -113,15 +114,15 @@ pub struct Cpu {
     brand: String,
 }
 
-impl Cpu {
+impl CpuInner {
     pub(crate) fn new(
         name: String,
         cpu_data: Arc<CpuData>,
         frequency: u64,
         vendor_id: String,
         brand: String,
-    ) -> Cpu {
-        Cpu {
+    ) -> Self {
+        Self {
             name,
             cpu_usage: 0f32,
             cpu_data,
@@ -147,27 +148,24 @@ impl Cpu {
     pub(crate) fn set_frequency(&mut self, frequency: u64) {
         self.frequency = frequency;
     }
-}
 
-impl CpuExt for Cpu {
-    fn cpu_usage(&self) -> f32 {
+    pub(crate) fn cpu_usage(&self) -> f32 {
         self.cpu_usage
     }
 
-    fn name(&self) -> &str {
+    pub(crate) fn name(&self) -> &str {
         &self.name
     }
 
-    /// Returns the CPU frequency in MHz.
-    fn frequency(&self) -> u64 {
+    pub(crate) fn frequency(&self) -> u64 {
         self.frequency
     }
 
-    fn vendor_id(&self) -> &str {
+    pub(crate) fn vendor_id(&self) -> &str {
         &self.vendor_id
     }
 
-    fn brand(&self) -> &str {
+    pub(crate) fn brand(&self) -> &str {
         &self.brand
     }
 }
@@ -229,7 +227,7 @@ fn get_idle(cpu_info: *mut i32, offset: isize) -> i32 {
 }
 
 pub(crate) fn compute_usage_of_cpu(proc_: &Cpu, cpu_info: *mut i32, offset: isize) -> f32 {
-    let old_cpu_info = proc_.data().cpu_info.0;
+    let old_cpu_info = proc_.inner.data().cpu_info.0;
     let in_use;
     let total;
 
@@ -270,7 +268,7 @@ pub(crate) fn update_cpu_usage<F: FnOnce(Arc<CpuData>, *mut i32) -> (f32, usize)
                 f(Arc::new(CpuData::new(cpu_info, num_cpu_info)), cpu_info);
             total_cpu_usage = total_percentage / len as f32;
         }
-        global_cpu.set_cpu_usage(total_cpu_usage);
+        global_cpu.inner.set_cpu_usage(total_cpu_usage);
     }
 }
 
@@ -287,7 +285,7 @@ pub(crate) fn init_cpus(
     let frequency = if refresh_kind.frequency() {
         unsafe { get_cpu_frequency() }
     } else {
-        global_cpu.frequency
+        global_cpu.frequency()
     };
 
     unsafe {
@@ -305,19 +303,21 @@ pub(crate) fn init_cpus(
         let mut percentage = 0f32;
         let mut offset = 0;
         for i in 0..num_cpu {
-            let mut p = Cpu::new(
-                format!("{}", i + 1),
-                Arc::clone(&proc_data),
-                frequency,
-                vendor_id.clone(),
-                brand.clone(),
-            );
+            let mut cpu = Cpu {
+                inner: CpuInner::new(
+                    format!("{}", i + 1),
+                    Arc::clone(&proc_data),
+                    frequency,
+                    vendor_id.clone(),
+                    brand.clone(),
+                ),
+            };
             if refresh_kind.cpu_usage() {
-                let cpu_usage = compute_usage_of_cpu(&p, cpu_info, offset);
-                p.set_cpu_usage(cpu_usage);
-                percentage += p.cpu_usage();
+                let cpu_usage = compute_usage_of_cpu(&cpu, cpu_info, offset);
+                cpu.inner.set_cpu_usage(cpu_usage);
+                percentage += cpu.cpu_usage();
             }
-            cpus.push(p);
+            cpus.push(cpu);
 
             offset += libc::CPU_STATE_MAX as isize;
         }
diff --git a/src/unix/apple/macos/component/arm.rs b/src/unix/apple/macos/component/arm.rs
index e3e0de1..e6634b4 100644
--- a/src/unix/apple/macos/component/arm.rs
+++ b/src/unix/apple/macos/component/arm.rs
@@ -16,31 +16,30 @@ use crate::sys::inner::ffi::{
     HID_DEVICE_PROPERTY_PRODUCT,
 };
 use crate::sys::utils::CFReleaser;
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
-#[doc = include_str!("../../../../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     components: Vec<Component>,
     client: Option<CFReleaser<__IOHIDEventSystemClient>>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         Self {
             components: vec![],
             client: None,
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         self.components.clear();
 
         unsafe {
diff --git a/src/unix/apple/macos/component/mod.rs b/src/unix/apple/macos/component/mod.rs
index 50b359e..7907cf7 100644
--- a/src/unix/apple/macos/component/mod.rs
+++ b/src/unix/apple/macos/component/mod.rs
@@ -4,10 +4,10 @@
 pub(crate) mod x86;
 
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-pub use self::x86::*;
+pub(crate) use self::x86::*;
 
 #[cfg(target_arch = "aarch64")]
 pub(crate) mod arm;
 
 #[cfg(target_arch = "aarch64")]
-pub use self::arm::*;
+pub(crate) use self::arm::*;
diff --git a/src/unix/apple/macos/component/x86.rs b/src/unix/apple/macos/component/x86.rs
index 282c875..a6dd97d 100644
--- a/src/unix/apple/macos/component/x86.rs
+++ b/src/unix/apple/macos/component/x86.rs
@@ -1,7 +1,7 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::sys::{ffi, macos::utils::IOReleaser};
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
 use libc::{c_char, c_int, c_void};
 
@@ -45,29 +45,28 @@ impl ComponentFFI {
 }
 
 // Used to get CPU information, not supported on iOS, or inside the default macOS sandbox.
-#[doc = include_str!("../../../../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     components: Vec<Component>,
     connection: Option<IoService>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         Self {
             components: Vec::with_capacity(2),
             connection: IoService::new_connection(),
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         if let Some(ref connection) = self.connection {
             let connection = connection.inner();
             self.components.clear();
diff --git a/src/unix/apple/mod.rs b/src/unix/apple/mod.rs
index 5329b74..d2a9f8c 100644
--- a/src/unix/apple/mod.rs
+++ b/src/unix/apple/mod.rs
@@ -24,12 +24,10 @@ pub mod system;
 pub mod users;
 mod utils;
 
-pub(crate) use self::component::ComponentInner;
-pub use self::component::Components;
-pub use self::cpu::Cpu;
+pub(crate) use self::component::{ComponentInner, ComponentsInner};
+pub(crate) use self::cpu::CpuInner;
 pub(crate) use self::disk::DiskInner;
-pub use self::network::NetworkData;
-pub(crate) use self::network::NetworksInner;
+pub(crate) use self::network::{NetworkDataInner, NetworksInner};
 pub(crate) use self::process::ProcessInner;
 pub(crate) use self::system::SystemInner;
 pub(crate) use crate::unix::users::get_users;
diff --git a/src/unix/apple/network.rs b/src/unix/apple/network.rs
index 76d55c0..2b19fab 100644
--- a/src/unix/apple/network.rs
+++ b/src/unix/apple/network.rs
@@ -7,7 +7,7 @@ use std::ptr::null_mut;
 
 use crate::common::MacAddr;
 use crate::network::refresh_networks_addresses;
-use crate::{NetworkExt, NetworksIter};
+use crate::{NetworkData, NetworksIter};
 
 macro_rules! old_and_new {
     ($ty_:expr, $name:ident, $old:ident, $new_val:expr) => {{
@@ -34,10 +34,10 @@ impl NetworksInner {
 
     pub(crate) fn refresh_list(&mut self) {
         for (_, data) in self.interfaces.iter_mut() {
-            data.updated = false;
+            data.inner.updated = false;
         }
         self.update_networks(true);
-        self.interfaces.retain(|_, data| data.updated);
+        self.interfaces.retain(|_, data| data.inner.updated);
         refresh_networks_addresses(&mut self.interfaces);
     }
 
@@ -102,6 +102,8 @@ impl NetworksInner {
                     match self.interfaces.entry(name) {
                         hash_map::Entry::Occupied(mut e) => {
                             let interface = e.get_mut();
+                            let interface = &mut interface.inner;
+
                             old_and_new!(
                                 interface,
                                 current_out,
@@ -152,20 +154,22 @@ impl NetworksInner {
                             let errors_out = (*if2m).ifm_data.ifi_oerrors;
 
                             e.insert(NetworkData {
-                                current_in,
-                                old_in: current_in,
-                                current_out,
-                                old_out: current_out,
-                                packets_in,
-                                old_packets_in: packets_in,
-                                packets_out,
-                                old_packets_out: packets_out,
-                                errors_in,
-                                old_errors_in: errors_in,
-                                errors_out,
-                                old_errors_out: errors_out,
-                                updated: true,
-                                mac_addr: MacAddr::UNSPECIFIED,
+                                inner: NetworkDataInner {
+                                    current_in,
+                                    old_in: current_in,
+                                    current_out,
+                                    old_out: current_out,
+                                    packets_in,
+                                    old_packets_in: packets_in,
+                                    packets_out,
+                                    old_packets_out: packets_out,
+                                    errors_in,
+                                    old_errors_in: errors_in,
+                                    errors_out,
+                                    old_errors_out: errors_out,
+                                    updated: true,
+                                    mac_addr: MacAddr::UNSPECIFIED,
+                                },
                             });
                         }
                     }
@@ -175,9 +179,8 @@ impl NetworksInner {
     }
 }
 
-#[doc = include_str!("../../../md_doc/network_data.md")]
 #[derive(PartialEq, Eq)]
-pub struct NetworkData {
+pub(crate) struct NetworkDataInner {
     current_in: u64,
     old_in: u64,
     current_out: u64,
@@ -195,56 +198,56 @@ pub struct NetworkData {
     pub(crate) mac_addr: MacAddr,
 }
 
-impl NetworkExt for NetworkData {
-    fn received(&self) -> u64 {
+impl NetworkDataInner {
+    pub(crate) fn received(&self) -> u64 {
         self.current_in.saturating_sub(self.old_in)
     }
 
-    fn total_received(&self) -> u64 {
+    pub(crate) fn total_received(&self) -> u64 {
         self.current_in
     }
 
-    fn transmitted(&self) -> u64 {
+    pub(crate) fn transmitted(&self) -> u64 {
         self.current_out.saturating_sub(self.old_out)
     }
 
-    fn total_transmitted(&self) -> u64 {
+    pub(crate) fn total_transmitted(&self) -> u64 {
         self.current_out
     }
 
-    fn packets_received(&self) -> u64 {
+    pub(crate) fn packets_received(&self) -> u64 {
         self.packets_in.saturating_sub(self.old_packets_in)
     }
 
-    fn total_packets_received(&self) -> u64 {
+    pub(crate) fn total_packets_received(&self) -> u64 {
         self.packets_in
     }
 
-    fn packets_transmitted(&self) -> u64 {
+    pub(crate) fn packets_transmitted(&self) -> u64 {
         self.packets_out.saturating_sub(self.old_packets_out)
     }
 
-    fn total_packets_transmitted(&self) -> u64 {
+    pub(crate) fn total_packets_transmitted(&self) -> u64 {
         self.packets_out
     }
 
-    fn errors_on_received(&self) -> u64 {
+    pub(crate) fn errors_on_received(&self) -> u64 {
         self.errors_in.saturating_sub(self.old_errors_in)
     }
 
-    fn total_errors_on_received(&self) -> u64 {
+    pub(crate) fn total_errors_on_received(&self) -> u64 {
         self.errors_in
     }
 
-    fn errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn errors_on_transmitted(&self) -> u64 {
         self.errors_out.saturating_sub(self.old_errors_out)
     }
 
-    fn total_errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn total_errors_on_transmitted(&self) -> u64 {
         self.errors_out
     }
 
-    fn mac_address(&self) -> MacAddr {
+    pub(crate) fn mac_address(&self) -> MacAddr {
         self.mac_addr
     }
 }
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs
index 04d25fd..2185062 100644
--- a/src/unix/apple/system.rs
+++ b/src/unix/apple/system.rs
@@ -5,7 +5,7 @@ use crate::sys::cpu::*;
 use crate::sys::process::*;
 use crate::sys::utils::{get_sys_value, get_sys_value_by_name};
 
-use crate::{CpuRefreshKind, LoadAvg, Pid, Process, ProcessRefreshKind};
+use crate::{Cpu, CpuRefreshKind, LoadAvg, Pid, Process, ProcessRefreshKind};
 
 use std::cell::UnsafeCell;
 use std::collections::HashMap;
diff --git a/src/unix/freebsd/component.rs b/src/unix/freebsd/component.rs
index 21fe47a..fb4722c 100644
--- a/src/unix/freebsd/component.rs
+++ b/src/unix/freebsd/component.rs
@@ -1,7 +1,7 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use super::utils::get_sys_value_by_name;
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
 pub(crate) struct ComponentInner {
     id: Vec<u8>,
@@ -49,14 +49,13 @@ unsafe fn refresh_component(id: &[u8]) -> Option<f32> {
     }
 }
 
-#[doc = include_str!("../../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     nb_cpus: usize,
     components: Vec<Component>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         let nb_cpus = unsafe { super::cpu::get_nb_cpus() };
         Self {
             nb_cpus,
@@ -64,15 +63,15 @@ impl ComponentsExt for Components {
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         self.components.clear();
         for core in 0..self.nb_cpus {
             unsafe {
diff --git a/src/unix/freebsd/cpu.rs b/src/unix/freebsd/cpu.rs
index 3ddeda1..bb5152c 100644
--- a/src/unix/freebsd/cpu.rs
+++ b/src/unix/freebsd/cpu.rs
@@ -3,7 +3,7 @@
 use crate::sys::utils::{
     get_sys_value_array, get_sys_value_by_name, get_sys_value_str_by_name, init_mib, VecSwitcher,
 };
-use crate::{CpuExt, CpuRefreshKind};
+use crate::{Cpu, CpuRefreshKind};
 
 use libc::{c_int, c_ulong};
 
@@ -46,7 +46,9 @@ impl CpusWrapper {
             init_mib(b"kern.cp_time\0", &mut mib_cp_time);
             init_mib(b"kern.cp_times\0", &mut mib_cp_times);
             Self {
-                global_cpu: Cpu::new(String::new(), String::new(), 0),
+                global_cpu: Cpu {
+                    inner: CpuInner::new(String::new(), String::new(), 0),
+                },
                 cpus: Vec::with_capacity(nb_cpus),
                 got_cpu_frequency: false,
                 mib_cp_time,
@@ -71,14 +73,15 @@ impl CpusWrapper {
                         frequency = get_frequency_for_cpu(pos);
                     }
                 }
-                self.cpus
-                    .push(Cpu::new(format!("cpu {pos}"), vendor_id.clone(), frequency));
+                self.cpus.push(Cpu {
+                    inner: CpuInner::new(format!("cpu {pos}"), vendor_id.clone(), frequency),
+                });
             }
             self.got_cpu_frequency = refresh_kind.frequency();
         } else if refresh_kind.frequency() && !self.got_cpu_frequency {
             for (pos, proc_) in self.cpus.iter_mut().enumerate() {
                 unsafe {
-                    proc_.frequency = get_frequency_for_cpu(pos);
+                    proc_.inner.frequency = get_frequency_for_cpu(pos);
                 }
             }
             self.got_cpu_frequency = true;
@@ -111,9 +114,9 @@ impl CpusWrapper {
 
             let total_diff = total_new.saturating_sub(total_old);
             if total_diff < 1 {
-                proc_.cpu_usage = 0.;
+                proc_.inner.cpu_usage = 0.;
             } else {
-                proc_.cpu_usage = cp_diff as f32 / total_diff as f32 * 100.;
+                proc_.inner.cpu_usage = cp_diff as f32 / total_diff as f32 * 100.;
             }
         }
 
@@ -132,43 +135,40 @@ impl CpusWrapper {
     }
 }
 
-#[doc = include_str!("../../../md_doc/cpu.md")]
-pub struct Cpu {
+pub(crate) struct CpuInner {
     pub(crate) cpu_usage: f32,
     name: String,
     pub(crate) vendor_id: String,
     pub(crate) frequency: u64,
 }
 
-impl Cpu {
-    pub(crate) fn new(name: String, vendor_id: String, frequency: u64) -> Cpu {
-        Cpu {
+impl CpuInner {
+    pub(crate) fn new(name: String, vendor_id: String, frequency: u64) -> Self {
+        Self {
             cpu_usage: 0.,
             name,
             vendor_id,
             frequency,
         }
     }
-}
 
-impl CpuExt for Cpu {
-    fn cpu_usage(&self) -> f32 {
+    pub(crate) fn cpu_usage(&self) -> f32 {
         self.cpu_usage
     }
 
-    fn name(&self) -> &str {
+    pub(crate) fn name(&self) -> &str {
         &self.name
     }
 
-    fn frequency(&self) -> u64 {
+    pub(crate) fn frequency(&self) -> u64 {
         self.frequency
     }
 
-    fn vendor_id(&self) -> &str {
+    pub(crate) fn vendor_id(&self) -> &str {
         &self.vendor_id
     }
 
-    fn brand(&self) -> &str {
+    pub(crate) fn brand(&self) -> &str {
         ""
     }
 }
diff --git a/src/unix/freebsd/mod.rs b/src/unix/freebsd/mod.rs
index a538ee8..cef20ef 100644
--- a/src/unix/freebsd/mod.rs
+++ b/src/unix/freebsd/mod.rs
@@ -8,12 +8,10 @@ pub mod process;
 pub mod system;
 mod utils;
 
-pub(crate) use self::component::ComponentInner;
-pub use self::component::Components;
-pub use self::cpu::Cpu;
+pub(crate) use self::component::{ComponentInner, ComponentsInner};
+pub(crate) use self::cpu::CpuInner;
 pub(crate) use self::disk::DiskInner;
-pub use self::network::NetworkData;
-pub(crate) use self::network::NetworksInner;
+pub(crate) use self::network::{NetworkDataInner, NetworksInner};
 pub(crate) use self::process::ProcessInner;
 pub(crate) use self::system::SystemInner;
 pub(crate) use crate::unix::users::get_users;
diff --git a/src/unix/freebsd/network.rs b/src/unix/freebsd/network.rs
index 1a7081b..57e0e0a 100644
--- a/src/unix/freebsd/network.rs
+++ b/src/unix/freebsd/network.rs
@@ -6,7 +6,7 @@ use std::mem::MaybeUninit;
 use super::utils;
 use crate::common::MacAddr;
 use crate::network::refresh_networks_addresses;
-use crate::{NetworkExt, NetworksIter};
+use crate::{NetworkData, NetworksIter};
 
 macro_rules! old_and_new {
     ($ty_:expr, $name:ident, $old:ident, $data:expr) => {{
@@ -35,7 +35,7 @@ impl NetworksInner {
             self.refresh_interfaces(true);
         }
         // Remove interfaces which are gone.
-        self.interfaces.retain(|_, n| n.updated);
+        self.interfaces.retain(|_, n| n.inner.updated);
         refresh_networks_addresses(&mut self.interfaces);
     }
 
@@ -62,7 +62,7 @@ impl NetworksInner {
         if refresh_all {
             // We don't need to update this value if we're not updating all interfaces.
             for interface in self.interfaces.values_mut() {
-                interface.updated = false;
+                interface.inner.updated = false;
             }
         }
         let mut data: libc::ifmibdata = MaybeUninit::zeroed().assume_init();
@@ -84,6 +84,7 @@ impl NetworksInner {
                 match self.interfaces.entry(name) {
                     hash_map::Entry::Occupied(mut e) => {
                         let interface = e.get_mut();
+                        let interface = &mut interface.inner;
 
                         old_and_new!(interface, ifi_ibytes, old_ifi_ibytes, data);
                         old_and_new!(interface, ifi_obytes, old_ifi_obytes, data);
@@ -99,20 +100,22 @@ impl NetworksInner {
                             continue;
                         }
                         e.insert(NetworkData {
-                            ifi_ibytes: data.ifi_ibytes,
-                            old_ifi_ibytes: 0,
-                            ifi_obytes: data.ifi_obytes,
-                            old_ifi_obytes: 0,
-                            ifi_ipackets: data.ifi_ipackets,
-                            old_ifi_ipackets: 0,
-                            ifi_opackets: data.ifi_opackets,
-                            old_ifi_opackets: 0,
-                            ifi_ierrors: data.ifi_ierrors,
-                            old_ifi_ierrors: 0,
-                            ifi_oerrors: data.ifi_oerrors,
-                            old_ifi_oerrors: 0,
-                            updated: true,
-                            mac_addr: MacAddr::UNSPECIFIED,
+                            inner: NetworkDataInner {
+                                ifi_ibytes: data.ifi_ibytes,
+                                old_ifi_ibytes: 0,
+                                ifi_obytes: data.ifi_obytes,
+                                old_ifi_obytes: 0,
+                                ifi_ipackets: data.ifi_ipackets,
+                                old_ifi_ipackets: 0,
+                                ifi_opackets: data.ifi_opackets,
+                                old_ifi_opackets: 0,
+                                ifi_ierrors: data.ifi_ierrors,
+                                old_ifi_ierrors: 0,
+                                ifi_oerrors: data.ifi_oerrors,
+                                old_ifi_oerrors: 0,
+                                updated: true,
+                                mac_addr: MacAddr::UNSPECIFIED,
+                            },
                         });
                     }
                 }
@@ -121,8 +124,7 @@ impl NetworksInner {
     }
 }
 
-#[doc = include_str!("../../../md_doc/network_data.md")]
-pub struct NetworkData {
+pub(crate) struct NetworkDataInner {
     /// Total number of bytes received over interface.
     ifi_ibytes: u64,
     old_ifi_ibytes: u64,
@@ -149,56 +151,56 @@ pub struct NetworkData {
     pub(crate) mac_addr: MacAddr,
 }
 
-impl NetworkExt for NetworkData {
-    fn received(&self) -> u64 {
+impl NetworkDataInner {
+    pub(crate) fn received(&self) -> u64 {
         self.ifi_ibytes.saturating_sub(self.old_ifi_ibytes)
     }
 
-    fn total_received(&self) -> u64 {
+    pub(crate) fn total_received(&self) -> u64 {
         self.ifi_ibytes
     }
 
-    fn transmitted(&self) -> u64 {
+    pub(crate) fn transmitted(&self) -> u64 {
         self.ifi_obytes.saturating_sub(self.old_ifi_obytes)
     }
 
-    fn total_transmitted(&self) -> u64 {
+    pub(crate) fn total_transmitted(&self) -> u64 {
         self.ifi_obytes
     }
 
-    fn packets_received(&self) -> u64 {
+    pub(crate) fn packets_received(&self) -> u64 {
         self.ifi_ipackets.saturating_sub(self.old_ifi_ipackets)
     }
 
-    fn total_packets_received(&self) -> u64 {
+    pub(crate) fn total_packets_received(&self) -> u64 {
         self.ifi_ipackets
     }
 
-    fn packets_transmitted(&self) -> u64 {
+    pub(crate) fn packets_transmitted(&self) -> u64 {
         self.ifi_opackets.saturating_sub(self.old_ifi_opackets)
     }
 
-    fn total_packets_transmitted(&self) -> u64 {
+    pub(crate) fn total_packets_transmitted(&self) -> u64 {
         self.ifi_opackets
     }
 
-    fn errors_on_received(&self) -> u64 {
+    pub(crate) fn errors_on_received(&self) -> u64 {
         self.ifi_ierrors.saturating_sub(self.old_ifi_ierrors)
     }
 
-    fn total_errors_on_received(&self) -> u64 {
+    pub(crate) fn total_errors_on_received(&self) -> u64 {
         self.ifi_ierrors
     }
 
-    fn errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn errors_on_transmitted(&self) -> u64 {
         self.ifi_oerrors.saturating_sub(self.old_ifi_oerrors)
     }
 
-    fn total_errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn total_errors_on_transmitted(&self) -> u64 {
         self.ifi_oerrors
     }
 
-    fn mac_address(&self) -> MacAddr {
+    pub(crate) fn mac_address(&self) -> MacAddr {
         self.mac_addr
     }
 }
diff --git a/src/unix/freebsd/system.rs b/src/unix/freebsd/system.rs
index 715c232..b1f2def 100644
--- a/src/unix/freebsd/system.rs
+++ b/src/unix/freebsd/system.rs
@@ -1,6 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{sys::Cpu, CpuRefreshKind, LoadAvg, Pid, Process, ProcessInner, ProcessRefreshKind};
+use crate::{Cpu, CpuRefreshKind, LoadAvg, Pid, Process, ProcessInner, ProcessRefreshKind};
 
 use std::cell::UnsafeCell;
 use std::collections::HashMap;
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs
index 5efc68c..91dca27 100644
--- a/src/unix/linux/component.rs
+++ b/src/unix/linux/component.rs
@@ -4,7 +4,7 @@
 //
 // Values in /sys/class/hwmonN are `c_long` or `c_ulong`
 // transposed to rust we only read `u32` or `i32` values.
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
 use std::collections::HashMap;
 use std::fs::{read_dir, File};
@@ -331,27 +331,26 @@ impl ComponentInner {
     }
 }
 
-#[doc = include_str!("../../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     components: Vec<Component>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         Self {
             components: Vec::with_capacity(4),
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         self.components.clear();
         if let Ok(dir) = read_dir(Path::new("/sys/class/hwmon/")) {
             for entry in dir.flatten() {
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs
index 60b652d..618b492 100644
--- a/src/unix/linux/cpu.rs
+++ b/src/unix/linux/cpu.rs
@@ -8,7 +8,7 @@ use std::io::{BufRead, BufReader, Read};
 use std::time::Instant;
 
 use crate::sys::utils::to_u64;
-use crate::{CpuExt, CpuRefreshKind};
+use crate::{Cpu, CpuRefreshKind};
 
 macro_rules! to_str {
     ($e:expr) => {
@@ -32,22 +32,24 @@ pub(crate) struct CpusWrapper {
 impl CpusWrapper {
     pub(crate) fn new() -> Self {
         Self {
-            global_cpu: Cpu::new_with_values(
-                "",
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
-                String::new(),
-                String::new(),
-            ),
+            global_cpu: Cpu {
+                inner: CpuInner::new_with_values(
+                    "",
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    0,
+                    String::new(),
+                    String::new(),
+                ),
+            },
             cpus: Vec::with_capacity(4),
             need_cpus_update: true,
             got_cpu_frequency: false,
@@ -102,11 +104,12 @@ impl CpusWrapper {
                     }
                     let mut parts = line.split(|x| *x == b' ').filter(|s| !s.is_empty());
                     if first {
-                        self.global_cpu.name = to_str!(parts.next().unwrap_or(&[])).to_owned();
+                        self.global_cpu.inner.name =
+                            to_str!(parts.next().unwrap_or(&[])).to_owned();
                     } else {
                         parts.next();
                     }
-                    self.global_cpu.set(
+                    self.global_cpu.inner.set(
                         parts.next().map(to_u64).unwrap_or(0),
                         parts.next().map(to_u64).unwrap_or(0),
                         parts.next().map(to_u64).unwrap_or(0),
@@ -131,25 +134,27 @@ impl CpusWrapper {
                                 Some((vendor_id, brand)) => (vendor_id, brand),
                                 None => (String::new(), String::new()),
                             };
-                            self.cpus.push(Cpu::new_with_values(
-                                to_str!(parts.next().unwrap_or(&[])),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                parts.next().map(to_u64).unwrap_or(0),
-                                0,
-                                vendor_id,
-                                brand,
-                            ));
+                            self.cpus.push(Cpu {
+                                inner: CpuInner::new_with_values(
+                                    to_str!(parts.next().unwrap_or(&[])),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    parts.next().map(to_u64).unwrap_or(0),
+                                    0,
+                                    vendor_id,
+                                    brand,
+                                ),
+                            });
                         } else {
                             parts.next(); // we don't want the name again
-                            self.cpus[i].set(
+                            self.cpus[i].inner.set(
                                 parts.next().map(to_u64).unwrap_or(0),
                                 parts.next().map(to_u64).unwrap_or(0),
                                 parts.next().map(to_u64).unwrap_or(0),
@@ -194,14 +199,17 @@ impl CpusWrapper {
             // `get_cpu_frequency` is very slow, so better run it in parallel.
             iter_mut(&mut self.cpus)
                 .enumerate()
-                .for_each(|(pos, proc_)| proc_.frequency = get_cpu_frequency(pos));
+                .for_each(|(pos, proc_)| proc_.inner.frequency = get_cpu_frequency(pos));
 
             self.got_cpu_frequency = true;
         }
     }
 
     pub(crate) fn get_global_raw_times(&self) -> (u64, u64) {
-        (self.global_cpu.total_time, self.global_cpu.old_total_time)
+        (
+            self.global_cpu.inner.total_time,
+            self.global_cpu.inner.old_total_time,
+        )
     }
 
     pub(crate) fn len(&self) -> usize {
@@ -299,8 +307,7 @@ impl CpuValues {
     }
 }
 
-#[doc = include_str!("../../../md_doc/cpu.md")]
-pub struct Cpu {
+pub(crate) struct CpuInner {
     old_values: CpuValues,
     new_values: CpuValues,
     pub(crate) name: String,
@@ -312,7 +319,7 @@ pub struct Cpu {
     pub(crate) brand: String,
 }
 
-impl Cpu {
+impl CpuInner {
     pub(crate) fn new_with_values(
         name: &str,
         user: u64,
@@ -328,12 +335,12 @@ impl Cpu {
         frequency: u64,
         vendor_id: String,
         brand: String,
-    ) -> Cpu {
+    ) -> Self {
         let mut new_values = CpuValues::new();
         new_values.set(
             user, nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice,
         );
-        Cpu {
+        Self {
             name: name.to_owned(),
             old_values: CpuValues::new(),
             new_values,
@@ -381,27 +388,25 @@ impl Cpu {
             self.cpu_usage = 100.; // to prevent the percentage to go above 100%
         }
     }
-}
 
-impl CpuExt for Cpu {
-    fn cpu_usage(&self) -> f32 {
+    pub(crate) fn cpu_usage(&self) -> f32 {
         self.cpu_usage
     }
 
-    fn name(&self) -> &str {
+    pub(crate) fn name(&self) -> &str {
         &self.name
     }
 
     /// Returns the CPU frequency in MHz.
-    fn frequency(&self) -> u64 {
+    pub(crate) fn frequency(&self) -> u64 {
         self.frequency
     }
 
-    fn vendor_id(&self) -> &str {
+    pub(crate) fn vendor_id(&self) -> &str {
         &self.vendor_id
     }
 
-    fn brand(&self) -> &str {
+    pub(crate) fn brand(&self) -> &str {
         &self.brand
     }
 }
diff --git a/src/unix/linux/mod.rs b/src/unix/linux/mod.rs
index 890fceb..1750b65 100644
--- a/src/unix/linux/mod.rs
+++ b/src/unix/linux/mod.rs
@@ -8,12 +8,10 @@ pub mod process;
 pub mod system;
 pub(crate) mod utils;
 
-pub(crate) use self::component::ComponentInner;
-pub use self::component::Components;
-pub use self::cpu::Cpu;
+pub(crate) use self::component::{ComponentInner, ComponentsInner};
+pub(crate) use self::cpu::CpuInner;
 pub(crate) use self::disk::DiskInner;
-pub use self::network::NetworkData;
-pub(crate) use self::network::NetworksInner;
+pub(crate) use self::network::{NetworkDataInner, NetworksInner};
 pub(crate) use self::process::ProcessInner;
 pub(crate) use self::system::SystemInner;
 pub(crate) use crate::unix::users::get_users;
diff --git a/src/unix/linux/network.rs b/src/unix/linux/network.rs
index 127a62e..095af6d 100644
--- a/src/unix/linux/network.rs
+++ b/src/unix/linux/network.rs
@@ -6,7 +6,7 @@ use std::{fs::File, u8};
 
 use crate::common::MacAddr;
 use crate::network::refresh_networks_addresses;
-use crate::{NetworkExt, NetworksIter};
+use crate::{NetworkData, NetworksIter};
 use std::collections::{hash_map, HashMap};
 
 macro_rules! old_and_new {
@@ -47,7 +47,7 @@ fn refresh_networks_list_from_sysfs(
         let mut data = vec![0; 30];
 
         for stats in interfaces.values_mut() {
-            stats.updated = false;
+            stats.inner.updated = false;
         }
 
         for entry in dir.flatten() {
@@ -67,6 +67,8 @@ fn refresh_networks_list_from_sysfs(
             match interfaces.entry(entry) {
                 hash_map::Entry::Occupied(mut e) => {
                     let interface = e.get_mut();
+                    let interface = &mut interface.inner;
+
                     old_and_new!(interface, rx_bytes, old_rx_bytes);
                     old_and_new!(interface, tx_bytes, old_tx_bytes);
                     old_and_new!(interface, rx_packets, old_rx_packets);
@@ -79,31 +81,33 @@ fn refresh_networks_list_from_sysfs(
                 }
                 hash_map::Entry::Vacant(e) => {
                     e.insert(NetworkData {
-                        rx_bytes,
-                        old_rx_bytes: rx_bytes,
-                        tx_bytes,
-                        old_tx_bytes: tx_bytes,
-                        rx_packets,
-                        old_rx_packets: rx_packets,
-                        tx_packets,
-                        old_tx_packets: tx_packets,
-                        rx_errors,
-                        old_rx_errors: rx_errors,
-                        tx_errors,
-                        old_tx_errors: tx_errors,
-                        mac_addr: MacAddr::UNSPECIFIED,
-                        // rx_compressed,
-                        // old_rx_compressed: rx_compressed,
-                        // tx_compressed,
-                        // old_tx_compressed: tx_compressed,
-                        updated: true,
+                        inner: NetworkDataInner {
+                            rx_bytes,
+                            old_rx_bytes: rx_bytes,
+                            tx_bytes,
+                            old_tx_bytes: tx_bytes,
+                            rx_packets,
+                            old_rx_packets: rx_packets,
+                            tx_packets,
+                            old_tx_packets: tx_packets,
+                            rx_errors,
+                            old_rx_errors: rx_errors,
+                            tx_errors,
+                            old_tx_errors: tx_errors,
+                            mac_addr: MacAddr::UNSPECIFIED,
+                            // rx_compressed,
+                            // old_rx_compressed: rx_compressed,
+                            // tx_compressed,
+                            // old_tx_compressed: tx_compressed,
+                            updated: true,
+                        },
                     });
                 }
             };
         }
 
         // Remove interfaces which are gone.
-        interfaces.retain(|_, d| d.updated);
+        interfaces.retain(|_, d| d.inner.updated);
     }
 }
 
@@ -126,7 +130,7 @@ impl NetworksInner {
         let mut v = vec![0; 30];
 
         for (interface_name, data) in self.interfaces.iter_mut() {
-            data.update(interface_name, &mut v);
+            data.inner.update(interface_name, &mut v);
         }
     }
 
@@ -136,8 +140,7 @@ impl NetworksInner {
     }
 }
 
-#[doc = include_str!("../../../md_doc/network_data.md")]
-pub struct NetworkData {
+pub(crate) struct NetworkDataInner {
     /// Total number of bytes received over interface.
     rx_bytes: u64,
     old_rx_bytes: u64,
@@ -174,7 +177,7 @@ pub struct NetworkData {
     updated: bool,
 }
 
-impl NetworkData {
+impl NetworkDataInner {
     fn update(&mut self, path: &str, data: &mut Vec<u8>) {
         let path = &Path::new("/sys/class/net/").join(path).join("statistics");
         old_and_new!(self, rx_bytes, old_rx_bytes, read(path, "rx_bytes", data));
@@ -216,58 +219,56 @@ impl NetworkData {
         //     read(path, "tx_compressed", data)
         // );
     }
-}
 
-impl NetworkExt for NetworkData {
-    fn received(&self) -> u64 {
+    pub(crate) fn received(&self) -> u64 {
         self.rx_bytes.saturating_sub(self.old_rx_bytes)
     }
 
-    fn total_received(&self) -> u64 {
+    pub(crate) fn total_received(&self) -> u64 {
         self.rx_bytes
     }
 
-    fn transmitted(&self) -> u64 {
+    pub(crate) fn transmitted(&self) -> u64 {
         self.tx_bytes.saturating_sub(self.old_tx_bytes)
     }
 
-    fn total_transmitted(&self) -> u64 {
+    pub(crate) fn total_transmitted(&self) -> u64 {
         self.tx_bytes
     }
 
-    fn packets_received(&self) -> u64 {
+    pub(crate) fn packets_received(&self) -> u64 {
         self.rx_packets.saturating_sub(self.old_rx_packets)
     }
 
-    fn total_packets_received(&self) -> u64 {
+    pub(crate) fn total_packets_received(&self) -> u64 {
         self.rx_packets
     }
 
-    fn packets_transmitted(&self) -> u64 {
+    pub(crate) fn packets_transmitted(&self) -> u64 {
         self.tx_packets.saturating_sub(self.old_tx_packets)
     }
 
-    fn total_packets_transmitted(&self) -> u64 {
+    pub(crate) fn total_packets_transmitted(&self) -> u64 {
         self.tx_packets
     }
 
-    fn errors_on_received(&self) -> u64 {
+    pub(crate) fn errors_on_received(&self) -> u64 {
         self.rx_errors.saturating_sub(self.old_rx_errors)
     }
 
-    fn total_errors_on_received(&self) -> u64 {
+    pub(crate) fn total_errors_on_received(&self) -> u64 {
         self.rx_errors
     }
 
-    fn errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn errors_on_transmitted(&self) -> u64 {
         self.tx_errors.saturating_sub(self.old_tx_errors)
     }
 
-    fn total_errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn total_errors_on_transmitted(&self) -> u64 {
         self.tx_errors
     }
 
-    fn mac_address(&self) -> MacAddr {
+    pub(crate) fn mac_address(&self) -> MacAddr {
         self.mac_addr
     }
 }
diff --git a/src/unix/linux/system.rs b/src/unix/linux/system.rs
index c39ddc9..cfa0f44 100644
--- a/src/unix/linux/system.rs
+++ b/src/unix/linux/system.rs
@@ -1,9 +1,9 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::sys::cpu::*;
+use crate::sys::cpu::{get_physical_core_count, CpusWrapper};
 use crate::sys::process::{_get_process_data, compute_cpu_usage, refresh_procs, unset_updated};
 use crate::sys::utils::{get_all_data, to_u64};
-use crate::{CpuRefreshKind, LoadAvg, Pid, Process, ProcessInner, ProcessRefreshKind};
+use crate::{Cpu, CpuRefreshKind, LoadAvg, Pid, Process, ProcessInner, ProcessRefreshKind};
 
 use libc::{self, c_char, sysconf, _SC_CLK_TCK, _SC_HOST_NAME_MAX, _SC_PAGESIZE};
 use std::cmp::min;
diff --git a/src/unknown/component.rs b/src/unknown/component.rs
index 04aa940..5be9276 100644
--- a/src/unknown/component.rs
+++ b/src/unknown/component.rs
@@ -1,6 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
 pub(crate) struct ComponentInner;
 
@@ -24,27 +24,26 @@ impl ComponentInner {
     pub(crate) fn refresh(&mut self) {}
 }
 
-#[doc = include_str!("../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     components: Vec<Component>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         Self {
             components: Vec::new(),
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         // Doesn't do anything.
     }
 }
diff --git a/src/unknown/cpu.rs b/src/unknown/cpu.rs
index 72b9be4..9de3df6 100644
--- a/src/unknown/cpu.rs
+++ b/src/unknown/cpu.rs
@@ -1,34 +1,29 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::CpuExt;
+pub(crate) struct CpuInner;
 
-#[doc = include_str!("../../md_doc/cpu.md")]
-pub struct Cpu {}
-
-impl Cpu {
-    pub(crate) fn new() -> Cpu {
-        Cpu {}
+impl CpuInner {
+    pub(crate) fn new() -> Self {
+        Self
     }
-}
 
-impl CpuExt for Cpu {
-    fn cpu_usage(&self) -> f32 {
+    pub(crate) fn cpu_usage(&self) -> f32 {
         0.0
     }
 
-    fn name(&self) -> &str {
+    pub(crate) fn name(&self) -> &str {
         ""
     }
 
-    fn frequency(&self) -> u64 {
+    pub(crate) fn frequency(&self) -> u64 {
         0
     }
 
-    fn vendor_id(&self) -> &str {
+    pub(crate) fn vendor_id(&self) -> &str {
         ""
     }
 
-    fn brand(&self) -> &str {
+    pub(crate) fn brand(&self) -> &str {
         ""
     }
 }
diff --git a/src/unknown/mod.rs b/src/unknown/mod.rs
index 038ff8e..06b15e3 100644
--- a/src/unknown/mod.rs
+++ b/src/unknown/mod.rs
@@ -8,12 +8,10 @@ pub mod process;
 pub mod system;
 pub mod users;
 
-pub(crate) use self::component::ComponentInner;
-pub use self::component::Components;
-pub use self::cpu::Cpu;
+pub(crate) use self::component::{ComponentInner, ComponentsInner};
+pub(crate) use self::cpu::CpuInner;
 pub(crate) use self::disk::{DiskInner, DisksInner};
-pub use self::network::NetworkData;
-pub(crate) use self::network::NetworksInner;
+pub(crate) use self::network::{NetworkDataInner, NetworksInner};
 pub(crate) use self::process::ProcessInner;
 pub(crate) use self::system::SystemInner;
 pub(crate) use self::users::get_users;
diff --git a/src/unknown/network.rs b/src/unknown/network.rs
index 53f0504..8b08aba 100644
--- a/src/unknown/network.rs
+++ b/src/unknown/network.rs
@@ -1,7 +1,7 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::common::MacAddr;
-use crate::{NetworkExt, NetworksIter};
+use crate::{NetworkData, NetworksIter};
 
 use std::collections::HashMap;
 
@@ -25,59 +25,58 @@ impl NetworksInner {
     pub(crate) fn refresh(&mut self) {}
 }
 
-#[doc = include_str!("../../md_doc/network_data.md")]
-pub struct NetworkData;
+pub(crate) struct NetworkDataInner;
 
-impl NetworkExt for NetworkData {
-    fn received(&self) -> u64 {
+impl NetworkDataInner {
+    pub(crate) fn received(&self) -> u64 {
         0
     }
 
-    fn total_received(&self) -> u64 {
+    pub(crate) fn total_received(&self) -> u64 {
         0
     }
 
-    fn transmitted(&self) -> u64 {
+    pub(crate) fn transmitted(&self) -> u64 {
         0
     }
 
-    fn total_transmitted(&self) -> u64 {
+    pub(crate) fn total_transmitted(&self) -> u64 {
         0
     }
 
-    fn packets_received(&self) -> u64 {
+    pub(crate) fn packets_received(&self) -> u64 {
         0
     }
 
-    fn total_packets_received(&self) -> u64 {
+    pub(crate) fn total_packets_received(&self) -> u64 {
         0
     }
 
-    fn packets_transmitted(&self) -> u64 {
+    pub(crate) fn packets_transmitted(&self) -> u64 {
         0
     }
 
-    fn total_packets_transmitted(&self) -> u64 {
+    pub(crate) fn total_packets_transmitted(&self) -> u64 {
         0
     }
 
-    fn errors_on_received(&self) -> u64 {
+    pub(crate) fn errors_on_received(&self) -> u64 {
         0
     }
 
-    fn total_errors_on_received(&self) -> u64 {
+    pub(crate) fn total_errors_on_received(&self) -> u64 {
         0
     }
 
-    fn errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn errors_on_transmitted(&self) -> u64 {
         0
     }
 
-    fn total_errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn total_errors_on_transmitted(&self) -> u64 {
         0
     }
 
-    fn mac_address(&self) -> MacAddr {
+    pub(crate) fn mac_address(&self) -> MacAddr {
         MacAddr::UNSPECIFIED
     }
 }
diff --git a/src/unknown/system.rs b/src/unknown/system.rs
index 7b772c2..c16a332 100644
--- a/src/unknown/system.rs
+++ b/src/unknown/system.rs
@@ -1,6 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{sys::Cpu, CpuRefreshKind, LoadAvg, Pid, Process, ProcessRefreshKind};
+use crate::{Cpu, CpuInner, CpuRefreshKind, LoadAvg, Pid, Process, ProcessRefreshKind};
 
 use std::collections::HashMap;
 
@@ -13,7 +13,9 @@ impl SystemInner {
     pub(crate) fn new() -> Self {
         Self {
             processes_list: Default::default(),
-            global_cpu: Cpu::new(),
+            global_cpu: Cpu {
+                inner: CpuInner::new(),
+            },
         }
     }
 
diff --git a/src/windows/component.rs b/src/windows/component.rs
index b0223ce..aa32973 100644
--- a/src/windows/component.rs
+++ b/src/windows/component.rs
@@ -1,6 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{Component, ComponentsExt};
+use crate::Component;
 
 use windows::core::w;
 use windows::Win32::Foundation::{SysAllocString, SysFreeString};
@@ -85,27 +85,26 @@ impl ComponentInner {
     }
 }
 
-#[doc = include_str!("../../md_doc/components.md")]
-pub struct Components {
+pub(crate) struct ComponentsInner {
     components: Vec<Component>,
 }
 
-impl ComponentsExt for Components {
-    fn new() -> Self {
+impl ComponentsInner {
+    pub(crate) fn new() -> Self {
         Self {
             components: Vec::new(),
         }
     }
 
-    fn components(&self) -> &[Component] {
+    pub(crate) fn components(&self) -> &[Component] {
         &self.components
     }
 
-    fn components_mut(&mut self) -> &mut [Component] {
+    pub(crate) fn components_mut(&mut self) -> &mut [Component] {
         &mut self.components
     }
 
-    fn refresh_list(&mut self) {
+    pub(crate) fn refresh_list(&mut self) {
         self.components = match ComponentInner::new() {
             Some(c) => vec![Component { inner: c }],
             None => Vec::new(),
diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs
index 1ba83d8..98fd549 100644
--- a/src/windows/cpu.rs
+++ b/src/windows/cpu.rs
@@ -1,7 +1,7 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
 use crate::sys::tools::KeyHandler;
-use crate::{CpuExt, CpuRefreshKind, LoadAvg};
+use crate::{Cpu, CpuRefreshKind, LoadAvg};
 
 use std::collections::HashMap;
 use std::ffi::c_void;
@@ -24,8 +24,8 @@ use windows::Win32::System::Power::{
 };
 use windows::Win32::System::SystemInformation;
 use windows::Win32::System::SystemInformation::{
-    GetLogicalProcessorInformationEx, RelationAll, RelationProcessorCore, SYSTEM_INFO,
-    SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX,
+    GetLogicalProcessorInformationEx, GetSystemInfo, RelationAll, RelationProcessorCore,
+    SYSTEM_INFO, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX,
 };
 use windows::Win32::System::Threading::{
     CreateEventA, RegisterWaitForSingleObject, INFINITE, WT_EXECUTEDEFAULT,
@@ -252,7 +252,14 @@ pub(crate) struct CpusWrapper {
 impl CpusWrapper {
     pub fn new() -> Self {
         Self {
-            global: Cpu::new_with_values("Total CPU".to_owned(), String::new(), String::new(), 0),
+            global: Cpu {
+                inner: CpuInner::new_with_values(
+                    "Total CPU".to_owned(),
+                    String::new(),
+                    String::new(),
+                    0,
+                ),
+            },
             cpus: Vec::new(),
             got_cpu_frequency: false,
         }
@@ -272,7 +279,7 @@ impl CpusWrapper {
 
     fn init_if_needed(&mut self, refresh_kind: CpuRefreshKind) {
         if self.cpus.is_empty() {
-            self.cpus = super::tools::init_cpus(refresh_kind);
+            self.cpus = init_cpus(refresh_kind);
             self.got_cpu_frequency = refresh_kind.frequency();
         }
     }
@@ -294,16 +301,16 @@ impl CpusWrapper {
         let frequencies = get_frequencies(self.cpus.len());
 
         for (cpu, frequency) in self.cpus.iter_mut().zip(frequencies) {
-            cpu.set_frequency(frequency);
+            cpu.inner.set_frequency(frequency);
         }
         self.global
+            .inner
             .set_frequency(self.cpus.get(0).map(|cpu| cpu.frequency()).unwrap_or(0));
         self.got_cpu_frequency = true;
     }
 }
 
-#[doc = include_str!("../../md_doc/cpu.md")]
-pub struct Cpu {
+pub(crate) struct CpuInner {
     name: String,
     cpu_usage: f32,
     key_used: Option<KeyHandler>,
@@ -312,36 +319,34 @@ pub struct Cpu {
     frequency: u64,
 }
 
-impl CpuExt for Cpu {
-    fn cpu_usage(&self) -> f32 {
+impl CpuInner {
+    pub(crate) fn cpu_usage(&self) -> f32 {
         self.cpu_usage
     }
 
-    fn name(&self) -> &str {
+    pub(crate) fn name(&self) -> &str {
         &self.name
     }
 
-    fn frequency(&self) -> u64 {
+    pub(crate) fn frequency(&self) -> u64 {
         self.frequency
     }
 
-    fn vendor_id(&self) -> &str {
+    pub(crate) fn vendor_id(&self) -> &str {
         &self.vendor_id
     }
 
-    fn brand(&self) -> &str {
+    pub(crate) fn brand(&self) -> &str {
         &self.brand
     }
-}
 
-impl Cpu {
     pub(crate) fn new_with_values(
         name: String,
         vendor_id: String,
         brand: String,
         frequency: u64,
-    ) -> Cpu {
-        Cpu {
+    ) -> Self {
+        Self {
             name,
             cpu_usage: 0f32,
             key_used: None,
@@ -461,7 +466,7 @@ pub(crate) fn get_vendor_id_and_brand(info: &SYSTEM_INFO) -> (String, String) {
 }
 
 pub(crate) fn get_key_used(p: &mut Cpu) -> &mut Option<KeyHandler> {
-    &mut p.key_used
+    &mut p.inner.key_used
 }
 
 // From https://stackoverflow.com/a/43813138:
@@ -554,3 +559,29 @@ pub(crate) fn get_physical_core_count() -> Option<usize> {
         Some(count)
     }
 }
+
+fn init_cpus(refresh_kind: CpuRefreshKind) -> Vec<Cpu> {
+    unsafe {
+        let mut sys_info = SYSTEM_INFO::default();
+        GetSystemInfo(&mut sys_info);
+        let (vendor_id, brand) = get_vendor_id_and_brand(&sys_info);
+        let nb_cpus = sys_info.dwNumberOfProcessors as usize;
+        let frequencies = if refresh_kind.frequency() {
+            get_frequencies(nb_cpus)
+        } else {
+            vec![0; nb_cpus]
+        };
+        let mut ret = Vec::with_capacity(nb_cpus + 1);
+        for (nb, frequency) in frequencies.iter().enumerate() {
+            ret.push(Cpu {
+                inner: CpuInner::new_with_values(
+                    format!("CPU {}", nb + 1),
+                    vendor_id.clone(),
+                    brand.clone(),
+                    *frequency,
+                ),
+            });
+        }
+        ret
+    }
+}
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index 62d2e49..951ec01 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -12,12 +12,10 @@ mod tools;
 mod users;
 mod utils;
 
-pub(crate) use self::component::ComponentInner;
-pub use self::component::Components;
-pub use self::cpu::Cpu;
+pub(crate) use self::component::{ComponentInner, ComponentsInner};
+pub(crate) use self::cpu::CpuInner;
 pub(crate) use self::disk::{DiskInner, DisksInner};
-pub use self::network::NetworkData;
-pub(crate) use self::network::NetworksInner;
+pub(crate) use self::network::{NetworkDataInner, NetworksInner};
 pub(crate) use self::process::ProcessInner;
 pub use self::sid::Sid;
 pub(crate) use self::system::SystemInner;
diff --git a/src/windows/network.rs b/src/windows/network.rs
index bf54e4c..bd567aa 100644
--- a/src/windows/network.rs
+++ b/src/windows/network.rs
@@ -2,7 +2,7 @@
 
 use crate::common::MacAddr;
 use crate::network::refresh_networks_addresses;
-use crate::{NetworkExt, NetworksIter};
+use crate::{NetworkData, NetworksIter};
 
 use std::collections::{hash_map, HashMap};
 
@@ -43,7 +43,7 @@ impl NetworksInner {
             }
 
             for (_, data) in self.interfaces.iter_mut() {
-                data.updated = false;
+                data.inner.updated = false;
             }
 
             // In here, this is tricky: we have to filter out the software interfaces to only keep
@@ -99,6 +99,7 @@ impl NetworksInner {
                 match self.interfaces.entry(interface_name) {
                     hash_map::Entry::Occupied(mut e) => {
                         let interface = e.get_mut();
+                        let interface = &mut interface.inner;
                         old_and_new!(interface, current_out, old_out, ptr.OutOctets);
                         old_and_new!(interface, current_in, old_in, ptr.InOctets);
                         old_and_new!(
@@ -122,21 +123,23 @@ impl NetworksInner {
                         let packets_out = ptr.OutUcastPkts.saturating_add(ptr.OutNUcastPkts);
 
                         e.insert(NetworkData {
-                            id: ptr.InterfaceLuid,
-                            current_out: ptr.OutOctets,
-                            old_out: ptr.OutOctets,
-                            current_in: ptr.InOctets,
-                            old_in: ptr.InOctets,
-                            packets_in,
-                            old_packets_in: packets_in,
-                            packets_out,
-                            old_packets_out: packets_out,
-                            errors_in: ptr.InErrors,
-                            old_errors_in: ptr.InErrors,
-                            errors_out: ptr.OutErrors,
-                            old_errors_out: ptr.OutErrors,
-                            mac_addr: MacAddr::UNSPECIFIED,
-                            updated: true,
+                            inner: NetworkDataInner {
+                                id: ptr.InterfaceLuid,
+                                current_out: ptr.OutOctets,
+                                old_out: ptr.OutOctets,
+                                current_in: ptr.InOctets,
+                                old_in: ptr.InOctets,
+                                packets_in,
+                                old_packets_in: packets_in,
+                                packets_out,
+                                old_packets_out: packets_out,
+                                errors_in: ptr.InErrors,
+                                old_errors_in: ptr.InErrors,
+                                errors_out: ptr.OutErrors,
+                                old_errors_out: ptr.OutErrors,
+                                mac_addr: MacAddr::UNSPECIFIED,
+                                updated: true,
+                            },
                         });
                     }
                 }
@@ -144,7 +147,7 @@ impl NetworksInner {
             let _err = FreeMibTable(table as _);
         }
         // Remove interfaces which are gone.
-        self.interfaces.retain(|_, d| d.updated);
+        self.interfaces.retain(|_, d| d.inner.updated);
         // Refresh all interfaces' addresses.
         refresh_networks_addresses(&mut self.interfaces);
     }
@@ -155,6 +158,7 @@ impl NetworksInner {
         unsafe {
             let mut entry = entry.assume_init();
             for (_, interface) in self.interfaces.iter_mut() {
+                let interface = &mut interface.inner;
                 entry.InterfaceLuid = interface.id;
                 entry.InterfaceIndex = 0; // to prevent the function to pick this one as index
                 if GetIfEntry2(&mut entry).is_err() {
@@ -181,8 +185,7 @@ impl NetworksInner {
     }
 }
 
-#[doc = include_str!("../../md_doc/network_data.md")]
-pub struct NetworkData {
+pub(crate) struct NetworkDataInner {
     id: NET_LUID_LH,
     current_out: u64,
     old_out: u64,
@@ -200,56 +203,56 @@ pub struct NetworkData {
     pub(crate) mac_addr: MacAddr,
 }
 
-impl NetworkExt for NetworkData {
-    fn received(&self) -> u64 {
+impl NetworkDataInner {
+    pub(crate) fn received(&self) -> u64 {
         self.current_in.saturating_sub(self.old_in)
     }
 
-    fn total_received(&self) -> u64 {
+    pub(crate) fn total_received(&self) -> u64 {
         self.current_in
     }
 
-    fn transmitted(&self) -> u64 {
+    pub(crate) fn transmitted(&self) -> u64 {
         self.current_out.saturating_sub(self.old_out)
     }
 
-    fn total_transmitted(&self) -> u64 {
+    pub(crate) fn total_transmitted(&self) -> u64 {
         self.current_out
     }
 
-    fn packets_received(&self) -> u64 {
+    pub(crate) fn packets_received(&self) -> u64 {
         self.packets_in.saturating_sub(self.old_packets_in)
     }
 
-    fn total_packets_received(&self) -> u64 {
+    pub(crate) fn total_packets_received(&self) -> u64 {
         self.packets_in
     }
 
-    fn packets_transmitted(&self) -> u64 {
+    pub(crate) fn packets_transmitted(&self) -> u64 {
         self.packets_out.saturating_sub(self.old_packets_out)
     }
 
-    fn total_packets_transmitted(&self) -> u64 {
+    pub(crate) fn total_packets_transmitted(&self) -> u64 {
         self.packets_out
     }
 
-    fn errors_on_received(&self) -> u64 {
+    pub(crate) fn errors_on_received(&self) -> u64 {
         self.errors_in.saturating_sub(self.old_errors_in)
     }
 
-    fn total_errors_on_received(&self) -> u64 {
+    pub(crate) fn total_errors_on_received(&self) -> u64 {
         self.errors_in
     }
 
-    fn errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn errors_on_transmitted(&self) -> u64 {
         self.errors_out.saturating_sub(self.old_errors_out)
     }
 
-    fn total_errors_on_transmitted(&self) -> u64 {
+    pub(crate) fn total_errors_on_transmitted(&self) -> u64 {
         self.errors_out
     }
 
-    fn mac_address(&self) -> MacAddr {
+    pub(crate) fn mac_address(&self) -> MacAddr {
         self.mac_addr
     }
 }
diff --git a/src/windows/process.rs b/src/windows/process.rs
index c09d603..d3e3299 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -489,7 +489,6 @@ impl ProcessInner {
         if refresh_kind.disk_usage() {
             update_disk_usage(self);
         }
-        update_memory(self);
         self.run_time = now.saturating_sub(self.start_time());
         self.updated = true;
     }
diff --git a/src/windows/system.rs b/src/windows/system.rs
index e9f3ac7..768829e 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -1,9 +1,9 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::{CpuRefreshKind, LoadAvg, Pid, ProcessRefreshKind};
+use crate::{Cpu, CpuRefreshKind, LoadAvg, Pid, ProcessRefreshKind};
 
 use crate::sys::cpu::*;
-use crate::sys::process::get_start_time;
+use crate::sys::process::{get_start_time, update_memory};
 use crate::sys::tools::*;
 use crate::sys::utils::{get_now, get_reg_string_value, get_reg_value_u32};
 use crate::{Process, ProcessInner};
@@ -116,6 +116,7 @@ impl SystemInner {
             if let Some(total_idle_time) = total_idle_time {
                 self.cpus
                     .global_cpu_mut()
+                    .inner
                     .set_cpu_usage(100.0 - total_idle_time);
             }
             for p in self.cpus.iter_mut(refresh_kind) {
@@ -128,7 +129,7 @@ impl SystemInner {
                     );
                 }
                 if let Some(idle_time) = idle_time {
-                    p.set_cpu_usage(100.0 - idle_time);
+                    p.inner.set_cpu_usage(100.0 - idle_time);
                 }
             }
             if refresh_kind.frequency() {
@@ -473,6 +474,7 @@ fn refresh_existing_process(
     } else {
         return Some(false);
     }
+    update_memory(proc_);
     proc_.update(refresh_kind, nb_cpus, now);
     proc_.updated = false;
     Some(true)
diff --git a/src/windows/tools.rs b/src/windows/tools.rs
index 1cbac54..842d555 100644
--- a/src/windows/tools.rs
+++ b/src/windows/tools.rs
@@ -1,9 +1,6 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
-use crate::sys::cpu::{self, Cpu, Query};
-use crate::CpuRefreshKind;
-
-use windows::Win32::System::SystemInformation::{GetSystemInfo, SYSTEM_INFO};
+use crate::sys::cpu::Query;
 
 pub(crate) struct KeyHandler {
     pub unique_id: String,
@@ -15,30 +12,6 @@ impl KeyHandler {
     }
 }
 
-pub(crate) fn init_cpus(refresh_kind: CpuRefreshKind) -> Vec<Cpu> {
-    unsafe {
-        let mut sys_info = SYSTEM_INFO::default();
-        GetSystemInfo(&mut sys_info);
-        let (vendor_id, brand) = cpu::get_vendor_id_and_brand(&sys_info);
-        let nb_cpus = sys_info.dwNumberOfProcessors as usize;
-        let frequencies = if refresh_kind.frequency() {
-            cpu::get_frequencies(nb_cpus)
-        } else {
-            vec![0; nb_cpus]
-        };
-        let mut ret = Vec::with_capacity(nb_cpus + 1);
-        for (nb, frequency) in frequencies.iter().enumerate() {
-            ret.push(Cpu::new_with_values(
-                format!("CPU {}", nb + 1),
-                vendor_id.clone(),
-                brand.clone(),
-                *frequency,
-            ));
-        }
-        ret
-    }
-}
-
 pub(crate) fn add_english_counter(
     s: String,
     query: &mut Query,


Test patch:
diff --git a/tests/cpu.rs b/tests/cpu.rs
index f803737..95c0bff 100644
--- a/tests/cpu.rs
+++ b/tests/cpu.rs
@@ -4,8 +4,6 @@
 
 #[test]
 fn test_cpu() {
-    use sysinfo::CpuExt;
-
     let mut s = sysinfo::System::new();
     assert!(s.cpus().is_empty());
 
@@ -40,8 +38,6 @@ fn test_physical_core_numbers() {
 
 #[test]
 fn test_global_cpu_info_not_set() {
-    use sysinfo::CpuExt;
-
     let mut s = sysinfo::System::new();
     assert_eq!(s.global_cpu_info().vendor_id(), "");
     assert_eq!(s.global_cpu_info().brand(), "");
diff --git a/tests/process.rs b/tests/process.rs
index dc263fc..4c8bc23 100644
--- a/tests/process.rs
+++ b/tests/process.rs
@@ -659,23 +659,3 @@ fn test_process_creds() {
         true
     }));
 }
-
-// Regression test for <https://github.com/GuillaumeGomez/sysinfo/issues/1084>
-#[test]
-fn test_process_memory_refresh() {
-    if !sysinfo::IS_SUPPORTED || cfg!(feature = "apple-sandbox") {
-        return;
-    }
-
-    // Ensure the process memory is available on the first refresh.
-    let mut s = sysinfo::System::new();
-
-    // Refresh our own process
-    let pid = Pid::from_u32(std::process::id());
-    s.refresh_process_specifics(pid, sysinfo::ProcessRefreshKind::new());
-
-    let proc = s.process(pid).unwrap();
-    // Check that the memory values re not empty.
-    assert!(proc.memory() > 0);
-    assert!(proc.virtual_memory() > 0);
-}