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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// SPDX-FileCopyrightText: 2026 Marissa (cuddle puddle) <dev@princess.lgbt>
//
// SPDX-License-Identifier: MPL-2.0
use ;
use PhantomData;
use ;
/**
* Returns a [`CustomDisplay`] that provides handling of [precision], [width],
* [fill and alignment] in the way specified by [`std::fmt`] for non-numeric
* types.
*
* For some type that implements [`Display`], returns a [`CustomDisplay`] that,
* when used by a [`Displayable`], truncates the formatted value based on
* [precision], pads it based on [width], [fill and alignment], and has a
* default [`Alignment`] of [`Left`]. This allows one to get the behavior
* specified by [`std::fmt`] for non-numeric types without having to implement
* the handling for [precision], [width], [fill and alignment] for their type.
* The returned [`CustomDisplay`] assumes all characters in formatted values
* have a monospace width of `1`.
*
* See also [`display_non_numeric()`].
*
* [precision]: std::fmt#precision
* [width]: std::fmt#width
* [fill and alignment]: std::fmt#fillalignment
* [`Displayable`]: crate::Displayable
* [`Alignment`]: std::fmt::Alignment
* [`Left`]: std::fmt::Alignment::Left
*/
/**
* Returns a wrapper around the given value that handles [precision], [width],
* [fill and alignment] in the way specified by [`std::fmt`] for non-numeric
* types.
*
* For some type that implements [`Display`], returns a wrapper that truncates
* the formatted value based on [precision], pads it based on [width],
* [fill and alignment], and has a default [`Alignment`] of [`Left`]. This
* allows one to get the behavior specified by [`std::fmt`] for non-numeric
* types without having to implement the handling for [precision], [width],
* [fill and alignment] for their type. This method assumes all characters in
* the formatted value have a monospace width of `1`.
*
* See also [`default_non_numeric()`].
*
* [precision]: std::fmt#precision
* [width]: std::fmt#width
* [fill and alignment]: std::fmt#fillalignment
* [`Alignment`]: std::fmt::Alignment
* [`Left`]: std::fmt::Alignment::Left
*/
/** See [`default_non_numeric()`]. */
>)
where
T: Display + ?Sized;