diff --git a/Cargo.toml b/Cargo.toml index 43fc476d7f891e6c4241d2ffeffa52ac412a5eee..e5a5731e3269dd6f54ecb69712968344678c386e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "pawd" -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "MIT" repository = "https://lab.themackabu.dev/crates/pawd" description = "Process analysis & watcher daemon" [dependencies] +serde_json = "1.0.108" psutil = { version = "3.2.2", features = ["serde"] } -serde = "1.0.192" -serde_derive = "1.0.192" +serde = { version = "1.0.192", features = ["derive"] } [dev-dependencies] -assert_matches = "1.5.0" \ No newline at end of file +assert_matches = "1.5.0" diff --git a/src/lib.rs b/src/lib.rs index 08a4f2e622c120175a503df44109d51faf5dde73..611890c9118d81702fbdb8e93a26dfa7d49549f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,6 +84,14 @@ impl Paw { } } +impl PawResult { + pub fn to_json(&self) -> String { serde_json::to_string(self).unwrap() } +} + +impl PawDone { + pub fn to_json(&self) -> String { serde_json::to_string(self).unwrap() } +} + #[cfg(test)] mod tests { use super::*; diff --git a/src/structs.rs b/src/structs.rs index 3a67bc72328325028f507cbd424561f538c9b4d7..d838b276f4f2c3a0451810ead544506a18ab9467 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -1,5 +1,5 @@ use psutil::process::MemoryInfo; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Deserialize, Serialize)] pub struct PawResult {