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
//! Configuration for [`strip_sensitive_literals`](crate::strip_sensitive_literals).
/// Controls how aggressively literals are redacted.
///
/// The default redacts scalar literals only. Scalars are integers, floats, and
/// strings. List and object literals keep their shape and the redactor recurses
/// into their elements.
///
/// Set [`hide_list_and_object_literals`](Self::hide_list_and_object_literals) to
/// `true` to also empty every list and object literal. An empty list or object
/// reveals nothing about the data it held, including its length and its keys.
///
/// An absent option and an explicit `false` behave the same. Only `true` turns
/// list and object emptying on.
///
/// # Construction
///
/// The struct is `#[non_exhaustive]`, so build it with [`StripOptions::default`]
/// or [`StripOptions::builder`] rather than a struct literal. New options can
/// then land in a minor release without breaking call sites. The fields stay
/// public for reading.
///
/// # Examples
///
/// ```
/// use graphql_strip_sensitive_literals::StripOptions;
///
/// // Default keeps list and object structure.
/// let keep = StripOptions::default();
/// assert!(!keep.hide_list_and_object_literals);
///
/// // Opt in to empty lists and objects.
/// let hide = StripOptions::builder()
/// .hide_list_and_object_literals(true)
/// .build();
/// assert!(hide.hide_list_and_object_literals);
/// ```
/// Builder for [`StripOptions`].
///
/// Created by [`StripOptions::builder`]. Each setter takes the builder by value
/// and returns it, so calls chain. Finish with [`build`](Self::build).