1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use super::math_node::NodeIndex;
use std::fmt;

#[derive(Default, Debug, Clone, Eq, PartialEq)]
pub struct Ci {
    pub name: Option<String>,
    pub parent: Option<NodeIndex>,
}

impl Ci {
    pub fn with_name(s: String) -> Self {
        Ci {
            name: Some(s),
            parent: None,
        }
    }
}

impl fmt::Display for Ci {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "text: {:?}, parent: {:?}", self.name, self.parent)
    }
}