@@ -18,17 +18,19 @@ macro_rules! unwrap_or_continue {
1818pub struct FuncFrameAttrsMap ( HashMap < String , FrameAttrs > ) ;
1919
2020impl FuncFrameAttrsMap {
21- /// Parse a FuncFrameAttrsMap from a file.
22- /// Each line should be a function name followed by a tab,
23- /// then a sequence of tab separated name=value pairs.
21+ /// Parse frame attributes from a file.
22+ ///
23+ /// Each line should consist of a function name, a tab (`\t`), and then a sequence of
24+ /// tab-separated `name=value` pairs.
2425 pub fn from_file ( path : & PathBuf ) -> io:: Result < FuncFrameAttrsMap > {
2526 let file = BufReader :: new ( File :: open ( path) ?) ;
2627 FuncFrameAttrsMap :: from_reader ( file)
2728 }
2829
29- /// Parse a FuncFrameAttrsMap from a reader.
30- /// Each line should be a function name followed by a tab,
31- /// then a sequence of tab separated name=value pairs.
30+ /// Parse frame attributes from a `BufRead`.
31+ ///
32+ /// Each line should consist of a function name, a tab (`\t`), and then a sequence of
33+ /// tab-separated `name=value` pairs.
3234 pub fn from_reader < R : BufRead > ( mut reader : R ) -> io:: Result < FuncFrameAttrsMap > {
3335 let mut funcattr_map = FuncFrameAttrsMap :: default ( ) ;
3436 let mut line = String :: new ( ) ;
@@ -77,56 +79,56 @@ impl FuncFrameAttrsMap {
7779 }
7880
7981 /// Return FrameAttrs for the given function name if it exists
80- pub fn frameattrs_for_func ( & self , func : & str ) -> Option < & FrameAttrs > {
82+ pub ( super ) fn frameattrs_for_func ( & self , func : & str ) -> Option < & FrameAttrs > {
8183 self . 0 . get ( func)
8284 }
8385}
8486
8587/// Attributes to set on the SVG elements of a frame
8688#[ derive( PartialEq , Eq , Debug , Default ) ]
87- pub struct FrameAttrs {
89+ pub ( super ) struct FrameAttrs {
8890 /// The text to include in the `title` element.
8991 /// If set to None, the title is dynamically generated based on the function name.
90- pub title : Option < String > ,
92+ pub ( super ) title : Option < String > ,
9193
92- pub g : GElementAttrs ,
93- pub a : AElementAttrs ,
94+ pub ( super ) g : GElementAttrs ,
95+ pub ( super ) a : AElementAttrs ,
9496}
9597
9698/// Attributes to set on the SVG `g` element.
9799/// Any of them set to `None` will get the default value.
98100#[ derive( PartialEq , Eq , Debug , Default ) ]
99- pub struct GElementAttrs {
101+ pub ( super ) struct GElementAttrs {
100102 /// Defaults to "func_g"
101- pub class : Option < String > ,
103+ pub ( super ) class : Option < String > ,
102104
103105 /// Will not be included if None
104- pub style : Option < String > ,
106+ pub ( super ) style : Option < String > ,
105107
106108 /// Defaults to "s(this)"
107- pub onmouseover : Option < String > ,
109+ pub ( super ) onmouseover : Option < String > ,
108110
109111 /// Defaults to "c()"
110- pub onmouseout : Option < String > ,
112+ pub ( super ) onmouseout : Option < String > ,
111113
112114 /// Defaults to "zoom(this)"
113- pub onclick : Option < String > ,
115+ pub ( super ) onclick : Option < String > ,
114116
115117 /// Extra attributes to include
116- pub extra : Vec < ( String , String ) > ,
118+ pub ( super ) extra : Vec < ( String , String ) > ,
117119}
118120
119121/// Attributes to set on the SVG `a` element
120122#[ derive( PartialEq , Eq , Debug , Default ) ]
121- pub struct AElementAttrs {
123+ pub ( super ) struct AElementAttrs {
122124 /// If set to None the `a` tag will not be added
123- pub href : Option < String > ,
125+ pub ( super ) href : Option < String > ,
124126
125127 /// Defaults to "_top"
126- pub target : Option < String > ,
128+ pub ( super ) target : Option < String > ,
127129
128130 /// Extra attributes to include
129- pub extra : Vec < ( String , String ) > ,
131+ pub ( super ) extra : Vec < ( String , String ) > ,
130132}
131133
132134fn parse_extra_attrs ( attrs : & mut Vec < ( String , String ) > , s : & str ) {
0 commit comments