1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use super::*;
pub struct PrintOptions {
pub max_width: u32,
pub indent_width: u8,
pub use_tabs: bool,
pub new_line_text: &'static str,
}
pub fn print<TString, TInfo, TCondition>(
print_items: PrintItems<TString, TInfo, TCondition>,
options: PrintOptions
) -> String where TString : StringTrait, TInfo : InfoTrait, TCondition : ConditionTrait<TString, TInfo, TCondition> {
let write_items = get_write_items(&print_items, GetWriteItemsOptions {
indent_width: options.indent_width,
max_width: options.max_width,
});
print_write_items(write_items, PrintWriteItemsOptions {
use_tabs: options.use_tabs,
new_line_text: options.new_line_text,
indent_width: options.indent_width,
})
}