Export data to CBOR

This commit is contained in:
Joscha 2022-09-30 19:49:54 +02:00
parent 499642cda9
commit 1ea09a9be9
4 changed files with 43 additions and 0 deletions

View file

@ -1,3 +1,6 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Page {
pub link_idx: u32,
pub ns: u16,
@ -6,12 +9,14 @@ pub struct Page {
pub redirect: bool,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Link {
pub to: u32,
pub start: u32,
pub end: u32,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AdjacencyList {
pub pages: Vec<Page>,
pub links: Vec<Link>,

View file

@ -178,5 +178,8 @@ pub fn ingest() -> io::Result<()> {
}
}
eprintln!("EXPORT");
ciborium::ser::into_writer(&second_stage, io::stdout()).unwrap();
Ok(())
}