Export data to CBOR
This commit is contained in:
parent
499642cda9
commit
1ea09a9be9
4 changed files with 43 additions and 0 deletions
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -178,5 +178,8 @@ pub fn ingest() -> io::Result<()> {
|
|||
}
|
||||
}
|
||||
|
||||
eprintln!("EXPORT");
|
||||
ciborium::ser::into_writer(&second_stage, io::stdout()).unwrap();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue