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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Multi-line text segments like [`List`]s or [`Tree`]s
pub use List;
pub use Tree;
use PhantomData;
use crate::;
/// Printing multi-line text segments
///
/// Similar to [`Inline`], but for multi-line segments like a [`List`] or a [`Tree`].
///
/// It is not necessarily designed for implementors that own the data they are printing.
/// Rather, implementors may be short-lived objects (constructed only to be printed) that are more about the *how* than the *what* to print, holding only references to the data itself.
/// In the case of [`List`] this takes the form of an [`Iterator`] ([`ExactSizeIterator`] to be precise), which is *consumed* when printed.
/// To enable such implementors, the `print()` function takes `self` by value.
/// Format items for printing
///
/// [`Formatter`] is basically the same as [`Inline`], except that the formatting isn't implemented by the *thing-to-be-printed* itself and that this [`Formatter`] may mutate itself.
/// This makes the trait very flexible.
/// Format items using their [`Pushable`] implementation
///
/// This carries the marker type needed by [`Pushable`] to pick the correct blanket implementation.
/// As with other uses of [`Pushable`], the marker type should be inferred automatically, and it's currently not possible to specify it explicitly.
///
/// Used by [`List`] as the "default" [`Formatter`] returned by its constructors.
;
/// Format items by wrapping them with an [`Inline`] implementor
///
/// Useful with the simple wrapper types [`Wrap`](crate::Wrap) and [`WrapBold`](crate::WrapBold), but can be used with any [`FnMut`] (e.g. a stateful closure) that returns an [`Inline`] implementor.
///
/// Used by [`List::with_wrap`].
;
/*
* FORMATTERS
*/