File: serde.md

package info (click to toggle)
rust-sysinfo 0.30.13-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,468 kB
  • sloc: ansic: 148; makefile: 27
file content (12 lines) | stat: -rw-r--r-- 312 bytes parent folder | download | duplicates (27)
1
2
3
4
5
6
7
8
9
10
11
12

With the `serde` feature enabled, you can then serialize `sysinfo` types. Let's see an example with `serde_json`:

```
use sysinfo::System;

let mut sys = System::new_all();
// First we update all information of our `System` struct.
sys.refresh_all();

println!("{}", serde_json::to_string(&sys).unwrap());
```