1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// use super::io::*;
// use crate::state::OCA;
use std::io::Read;

pub type GenericError = Box<dyn std::error::Error + Sync + Send>;
pub type GenericResult<T> = Result<T, GenericError>;

pub fn load(_source: &mut dyn Read) -> GenericResult<()> {
    /*
    let v: OCA = serde_json::from_reader(source)?;
    println!("{:?}", v);
    */

    Ok(())
}

#[cfg(test)]
mod tests {
    use super::load;

    #[test]
    fn loads_json_from_str() {
        let data = r#"
 { 
 "capture_base": {"type": "abc", "classification": "def", "attributes": {}, "pii": []},
 "overlays": []
 }
        "#;
        load(&mut data.as_bytes()).unwrap();
    }
}