initial commit with code I worked on in rust-playground
This commit is contained in:
20
main.rs
Normal file
20
main.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
mod blocktree;
|
||||
|
||||
use crate::blocktree::{NoteBlock, NotePage};
|
||||
|
||||
fn main() {
|
||||
let root_block = NoteBlock::new(0,Some(1),Some(2),String::from("hello"));
|
||||
let mut page = NotePage::new(String::from("page 1"), 0, root_block);
|
||||
let new_block = NoteBlock::new(1,None,None, String::from("world"));
|
||||
page.insert(new_block);
|
||||
let new_block = NoteBlock::new(2,Some(3),None, String::from("world"));
|
||||
page.insert(new_block);
|
||||
let new_block = NoteBlock::new(3,Some(4),None, String::from("world"));
|
||||
page.insert(new_block);
|
||||
let new_block = NoteBlock::new(4,None,None, String::from("world"));
|
||||
page.insert(new_block);
|
||||
page.build_tree();
|
||||
|
||||
println!("{:?}", page);
|
||||
// println!("{:?}", page.block_tree_root.first_child_node)
|
||||
}
|
||||
Reference in New Issue
Block a user