Upload crates/iosdiag-core/src/collectors/mod.rs with huggingface_hub
Browse files
crates/iosdiag-core/src/collectors/mod.rs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//! Data collectors for evidence gathering
|
| 2 |
+
|
| 3 |
+
pub mod device_info;
|
| 4 |
+
pub mod battery;
|
| 5 |
+
pub mod charging;
|
| 6 |
+
pub mod nand;
|
| 7 |
+
pub mod wifi;
|
| 8 |
+
pub mod thermal;
|
| 9 |
+
pub mod reboot;
|
| 10 |
+
|
| 11 |
+
use async_trait::async_trait;
|
| 12 |
+
|
| 13 |
+
/// Evidence item collected from device
|
| 14 |
+
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
| 15 |
+
pub struct EvidenceItem {
|
| 16 |
+
pub id: String,
|
| 17 |
+
pub evidence_type: String,
|
| 18 |
+
pub source: String,
|
| 19 |
+
pub timestamp: String,
|
| 20 |
+
pub device_udid: String,
|
| 21 |
+
pub payload: serde_json::Value,
|
| 22 |
+
pub hash: String,
|
| 23 |
+
pub notes: String,
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/// Collector trait for gathering evidence
|
| 27 |
+
#[async_trait]
|
| 28 |
+
pub trait Collector: Send + Sync {
|
| 29 |
+
fn name(&self) -> &'static str;
|
| 30 |
+
async fn collect(&self, ctx: &CollectContext) -> crate::Result<Vec<EvidenceItem>>;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/// Collection context
|
| 34 |
+
pub struct CollectContext {
|
| 35 |
+
pub device_udid: String,
|
| 36 |
+
pub timestamp: String,
|
| 37 |
+
}
|