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
//! Showing a value whose type may or may not be showable.
//!
//! A declared field holds whatever its type is, and nothing requires that type
//! to implement `Debug`. Generated code still has to print it - in the struct's
//! own `Debug`, and in [`FieldView::value`](crate::observability::FieldView).
//!
//! The pick happens at compile time and costs nothing at runtime. An inherent
//! method on `Shown<T>` is reached before one on `&Shown<T>`, so a `T` that
//! implements `Debug` takes the first and everything else falls to the second -
//! which is how a trait bound is asked about without a `where` clause to say it
//! in.
//!
//! Everything here is `doc(hidden)`. It is public because an expansion lands in
//! the caller's crate and has to name it; the two traits mean nothing written
//! by hand, and nothing outside a generated `Debug` should be reading them.
use fmt;
/// What stands in for a value whose type cannot be printed.
;
/// The one that stands in for every value that cannot be printed.
///
/// A `static` rather than a temporary, because what is handed back outlives
/// the `Shown` that was asked.
static OPAQUE: Opaque = Opaque;
/// A value being asked whether it can be shown.
;