1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
use std::collections::HashMap;

pub type Element = Vec<Node>;

pub enum Node {
    Tag(Tag),
    Text(String),
}

pub struct Tag {
    pub name: String,
    // TODO: more type safety
    pub attributes: HashMap<String, String>,
    pub children: Vec<Element>,
}