mathml_rs/structs/ci.rs
1use super::math_node::NodeIndex;
2use std::fmt;
3
4#[derive(Default, Debug, Clone, Eq, PartialEq)]
5pub struct Ci {
6 pub name: Option<String>,
7 pub parent: Option<NodeIndex>,
8}
9
10impl Ci {
11 pub fn with_name(s: String) -> Self {
12 Ci {
13 name: Some(s),
14 parent: None,
15 }
16 }
17}
18
19impl fmt::Display for Ci {
20 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21 write!(f, "text: {:?}, parent: {:?}", self.name, self.parent)
22 }
23}