length_delimited/
sealed.rs

1macro_rules! doc {
2  (@bounds { $($item:item)* }) => {
3    $(
4      /// A trait bound that bounds `Send`, `Sync`, and `'static` in possible combinations
5      ///
6      /// which can be configured with features.
7      $item
8    )*
9  };
10  (@error_bounds { $($item:item)* }) => {
11    $(
12      /// A trait bound that bounds `Debug`, `Display`, `Error`, `Send`, `Sync`, and `'static` in possible combinations
13      ///
14      /// which can be configured with features.
15      $item
16    )*
17  };
18}
19
20doc!(@bounds {
21  #[cfg(not(any(feature = "send", feature = "sync", feature = "static")))]
22  pub trait Bounds {}
23
24  #[cfg(all(feature = "sync", not(any(feature = "send", feature = "static"))))]
25  pub trait Bounds: Sync {}
26
27  #[cfg(all(feature = "send", not(any(feature = "sync", feature = "static"))))]
28  pub trait Bounds: Send {}
29
30  #[cfg(all(feature = "static", not(any(feature = "send", feature = "sync"))))]
31  pub trait Bounds: 'static {}
32
33  #[cfg(all(feature = "sync", feature = "send", not(feature = "static")))]
34  pub trait Bounds: Send + Sync {}
35
36  #[cfg(all(feature = "sync", feature = "static", not(feature = "send")))]
37  pub trait Bounds: Sync + 'static {}
38
39  #[cfg(all(feature = "send", feature = "static", not(feature = "sync")))]
40  pub trait Bounds: Send + 'static {}
41
42  #[cfg(all(feature = "send", feature = "sync", feature = "static"))]
43  pub trait Bounds: Send + Sync + 'static {}
44});
45
46#[cfg(not(any(feature = "send", feature = "sync", feature = "static")))]
47impl<T> Bounds for T {}
48
49#[cfg(all(feature = "sync", not(any(feature = "send", feature = "static"))))]
50impl<T> Bounds for T where T: Sync {}
51
52#[cfg(all(feature = "send", not(any(feature = "sync", feature = "static"))))]
53impl<T> Bounds for T where T: Send {}
54
55#[cfg(all(feature = "static", not(any(feature = "send", feature = "sync"))))]
56impl<T> Bounds for T where T: 'static {}
57
58#[cfg(all(feature = "sync", feature = "send", not(feature = "static")))]
59impl<T> Bounds for T where T: Send + Sync {}
60
61#[cfg(all(feature = "sync", feature = "static", not(feature = "send")))]
62impl<T> Bounds for T where T: Sync + 'static {}
63
64#[cfg(all(feature = "send", feature = "static", not(feature = "sync")))]
65impl<T> Bounds for T where T: Send + 'static {}
66
67#[cfg(all(feature = "send", feature = "sync", feature = "static"))]
68impl<T> Bounds for T where T: Send + Sync + 'static {}
69
70#[cfg(not(any(feature = "debug", feature = "display", feature = "error")))]
71pub trait Printable {}
72
73#[cfg(not(any(feature = "debug", feature = "display", feature = "error")))]
74impl<T> Printable for T {}
75
76#[cfg(all(feature = "debug", not(any(feature = "display", feature = "error"))))]
77pub trait Printable: core::fmt::Debug {}
78
79#[cfg(all(feature = "debug", not(any(feature = "display", feature = "error"))))]
80impl<T> Printable for T where T: core::fmt::Debug {}
81
82#[cfg(all(feature = "display", not(any(feature = "debug", feature = "error"))))]
83pub trait Printable: core::fmt::Display {}
84
85#[cfg(all(feature = "display", not(any(feature = "debug", feature = "error"))))]
86impl<T> Printable for T where T: core::fmt::Display {}
87
88#[cfg(all(feature = "display", feature = "debug", not(any(feature = "error"))))]
89pub trait Printable: core::fmt::Display + core::fmt::Debug {}
90
91#[cfg(all(feature = "display", feature = "debug", not(any(feature = "error"))))]
92impl<T> Printable for T where T: core::fmt::Display + core::fmt::Debug {}
93
94#[cfg(feature = "error")]
95pub trait Printable: core::error::Error {}
96
97#[cfg(feature = "error")]
98impl<T> Printable for T where T: core::error::Error {}
99
100#[cfg(not(any(feature = "send", feature = "sync", feature = "static",)))]
101impl<T> ErrorBounds for T where T: Printable {}
102
103#[cfg(all(feature = "sync", not(any(feature = "send", feature = "static"))))]
104impl<T> ErrorBounds for T where T: Printable + Sync {}
105
106#[cfg(all(feature = "send", not(any(feature = "sync", feature = "static"))))]
107impl<T> ErrorBounds for T where T: Printable + Send {}
108
109#[cfg(all(feature = "static", not(any(feature = "send", feature = "sync"))))]
110impl<T> ErrorBounds for T where T: Printable + 'static {}
111
112#[cfg(all(feature = "sync", feature = "send", not(feature = "static")))]
113impl<T> ErrorBounds for T where T: Printable + Send + Sync {}
114
115#[cfg(all(feature = "sync", feature = "static", not(feature = "send")))]
116impl<T> ErrorBounds for T where T: Printable + Sync + 'static {}
117
118#[cfg(all(feature = "send", feature = "static", not(feature = "sync")))]
119impl<T> ErrorBounds for T where T: Printable + Send + 'static {}
120
121#[cfg(all(feature = "send", feature = "sync", feature = "static"))]
122impl<T> ErrorBounds for T where T: Printable + Send + Sync + 'static {}
123
124doc!(@error_bounds {
125  #[cfg(not(any(feature = "send", feature = "sync", feature = "static",)))]
126  pub trait ErrorBounds: Printable {}
127
128  #[cfg(all(feature = "sync", not(any(feature = "send", feature = "static"))))]
129  pub trait ErrorBounds: Printable + Sync {}
130
131  #[cfg(all(feature = "send", not(any(feature = "sync", feature = "static"))))]
132  pub trait ErrorBounds: Printable + Send {}
133
134  #[cfg(all(feature = "static", not(any(feature = "send", feature = "sync"))))]
135  pub trait ErrorBounds: Printable + 'static {}
136
137  #[cfg(all(feature = "sync", feature = "send", not(feature = "static")))]
138  pub trait ErrorBounds: Printable + Send + Sync {}
139
140  #[cfg(all(feature = "sync", feature = "static", not(feature = "send")))]
141  pub trait ErrorBounds: Printable + Sync + 'static {}
142
143  #[cfg(all(feature = "send", feature = "static", not(feature = "sync")))]
144  pub trait ErrorBounds: Printable + Send + 'static {}
145
146  #[cfg(all(feature = "send", feature = "sync", feature = "static"))]
147  pub trait ErrorBounds: Printable + Send + Sync + 'static {}
148});