diff --git a/Cargo.lock b/Cargo.lock index e5df891..81b11c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -369,6 +369,7 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", "windows-link", ] diff --git a/idevice/Cargo.toml b/idevice/Cargo.toml index d6ed576..e69ac18 100644 --- a/idevice/Cargo.toml +++ b/idevice/Cargo.toml @@ -30,7 +30,9 @@ base64 = { version = "0.22" } indexmap = { version = "2.7", features = ["serde"], optional = true } uuid = { version = "1.12", features = ["serde", "v4"], optional = true } -chrono = { version = "0.4.40", optional = true, default-features = false } +chrono = { version = "0.4.40", optional = true, default-features = false, features = [ + "serde", +] } serde_json = { version = "1", optional = true } json = { version = "0.12", optional = true } diff --git a/idevice/src/services/os_trace_relay.rs b/idevice/src/services/os_trace_relay.rs index 9fb07d3..e675ef6 100644 --- a/idevice/src/services/os_trace_relay.rs +++ b/idevice/src/services/os_trace_relay.rs @@ -4,6 +4,7 @@ //! https://github.com/doronz88/pymobiledevice3/blob/master/pymobiledevice3/services/os_trace.py use chrono::{DateTime, NaiveDateTime}; +use serde::{Deserialize, Serialize}; use tokio::io::AsyncWriteExt; use crate::{Idevice, IdeviceError, IdeviceService, obf}; @@ -30,7 +31,7 @@ pub struct OsTraceRelayReceiver { inner: OsTraceRelayClient, } -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct OsTraceLog { pub pid: u32, pub timestamp: NaiveDateTime, @@ -41,13 +42,13 @@ pub struct OsTraceLog { pub label: Option, } -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct SyslogLabel { pub subsystem: String, pub category: String, } -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum LogLevel { Notice = 0, Info = 1,