indent_display/lib.rs
1/*a Copyright
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14
15@file indent.rs
16@brief An indented display system
17 */
18
19//a Documentation
20/*!
21
22# Indent
23
24This is a fairly simple indented display system designed for standard
25library (not simply core) applications.
26
27```
28use indent_display::{Indenter, NullOptions, DefaultIndentedDisplay, IndentedDisplay};
29let mut stdout = std::io::stdout();
30let mut ind = Indenter::new(&mut stdout, " ", &NullOptions {});
31"Not indented\n".indent(&mut ind);
32{
33 let mut sub = ind.sub();
34 "Indented once with two spaces\n".indent(&mut ind);
35}
36{
37 let mut sub = ind.push("...");
38 "Indented once with three dots\n".indent(&mut ind);
39 {
40 let mut sub = sub.push("***");
41 "Indented with three dots and three stars\nAnd so is this".indent(&mut ind);
42 }
43 {
44 let mut sub = sub.sub();
45 "Indented with three dots and two spaces stars\nAnd so is this".indent(&mut ind);
46 }
47}
48"Not indented\n".indent(&mut ind);
49```
50
51!*/
52
53//a Imports
54mod defaults;
55mod indenter;
56mod test;
57mod traits;
58mod types;
59
60//a Exports
61pub use traits::{DefaultIndentedDisplay, IndentedDisplay, IndentedOptions};
62pub use types::NullOptions;
63// pub use defaults::{};
64pub use indenter::Indenter;