macro_rules! id {
() => { ... };
(html$e:expr) => { ... };
(esc$e:expr) => { ... };
($e:expr) => { ... };
}
Expand description
represents an id for node or subgraph in dot lang. #Arguments:
- html - html format.
- esc - escaped string. It allows the escaped quotes inside and also wraps the string to the quotas #Example:
fn id_test() {
use dot_generator::*;
use dot_structures::*;
assert_eq!(id!(), Id::Anonymous("".to_string()));
assert_eq!(id!(html "<<abc>>"), Id::Html("<<abc>>".to_string()));
assert_eq!(id!("abc"), Id::Plain("abc".to_string()));
assert_eq!(id!(esc r#"ab\"c"#"), Id::Escaped(r#"\"ab\"c\""#.to_string()));
}