Skip to content

Commit

Permalink
Remove ProcessExt trait
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 11, 2023
1 parent c3ed8a9 commit 1682569
Show file tree
Hide file tree
Showing 30 changed files with 770 additions and 712 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Otherwise, here is a little code sample:
```rust
use sysinfo::{
Components, ComponentsExt, Disks, NetworkExt, Networks,
NetworksExt, ProcessExt, System,
NetworksExt, System,
};

// Please note that we use "new_all" to ensure that all list of
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use std::io::{self, BufRead, Write};
use std::str::FromStr;
use sysinfo::Signal::*;
use sysinfo::{
Components, ComponentsExt, CpuExt, Disks, NetworkExt, Networks, NetworksExt, Pid, ProcessExt,
Signal, System, UserExt, Users, UsersExt,
Components, ComponentsExt, CpuExt, Disks, NetworkExt, Networks, NetworksExt, Pid, Signal,
System, UserExt, Users, UsersExt,
};

const signals: &[Signal] = &[
Expand Down
10 changes: 0 additions & 10 deletions md_doc/process.md

This file was deleted.

2 changes: 1 addition & 1 deletion md_doc/supported_signals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Returns the list of the supported signals on this system (used by
[`ProcessExt::kill_with`][crate::ProcessExt::kill_with]).
[`Process::kill_with`][crate::Process::kill_with]).

```
use sysinfo::{System, SUPPORTED_SIGNALS};
Expand Down
6 changes: 3 additions & 3 deletions src/c_interface.rs
Original file line number Diff line number Diff line change
@@ -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, NetworksExt, Pid, Process, ProcessExt, System};
use crate::{CpuExt, Disks, NetworkExt, Networks, NetworksExt, Pid, Process, System};
use libc::{self, c_char, c_float, c_uint, c_void, size_t};
use std::borrow::BorrowMut;
use std::ffi::CString;
Expand Down Expand Up @@ -416,12 +416,12 @@ pub extern "C" fn sysinfo_process_tasks(
if let Some(fn_pointer) = fn_pointer {
unsafe {
let process = process as *const Process;
for (pid, process) in (*process).tasks.iter() {
for (pid, process) in (*process).tasks().iter() {
if !fn_pointer(pid.0, process as *const Process as CProcess, data) {
break;
}
}
(*process).tasks.len() as size_t
(*process).tasks().len() as size_t
}
} else {
0
Expand Down
Loading

0 comments on commit 1682569

Please sign in to comment.