rustc/vendor/sysinfo-0.33.0/md_doc/serde.md
2025-02-17 11:14:05 +01:00

312 B

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());