Crates.io | se_dump |
lib.rs | se_dump |
version | 0.1.0 |
source | src |
created_at | 2023-01-06 12:37:11.327245 |
updated_at | 2023-01-06 12:37:11.327245 |
description | Some structs to facilitate parsing of StackExchange dumps into easy-to-use values |
homepage | |
repository | https://gitlab.com/reinis-mazeiks/se_dump |
max_upload_size | |
id | 752272 |
size | 15,048 |
Some structs to facilitate parsing of StackExchange dumps into easy-to-use values.
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
use quick_xml::de::from_reader;
use se_dump::post::{PostId, Posts, PostType};
let reader = BufReader::new(File::open(Path::new("sample_data/Posts.xml")).unwrap());
let posts: Posts = from_reader(reader).unwrap();
assert_eq!(posts.posts[0].id, PostId(2115));
assert_eq!(posts.posts[0].post_type, PostType::Answer);
Currently, only Post and PostLink structs are provided22