devela/data/list/tuple/
mod.rs
1#[cfg(test)]
11mod tests;
12
13#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "_tuple")))]
14mod codegen {
15 use crate::{Debug, Display, FmtResult, Formatter};
16
17 include!(concat!(env!("OUT_DIR"), "/build/tuple.rs"));
20
21 trait Sealed {}
23
24 #[repr(transparent)]
26 pub struct TupleFmt<'a, T: Tuple>(&'a T);
27
28 trait TupleDebug: Tuple {
30 fn fmt_debug(&self, f: &mut Formatter) -> FmtResult<()>;
31 }
32 impl<T: TupleDebug> Debug for TupleFmt<'_, T> {
33 fn fmt(&self, f: &mut Formatter) -> FmtResult<()> {
34 self.0.fmt_debug(f)
35 }
36 }
37
38 trait TupleDisplay: Tuple {
40 fn fmt_display(&self, f: &mut Formatter) -> FmtResult<()>;
41 }
42 impl<T: TupleDisplay> Display for TupleFmt<'_, T> {
43 fn fmt(&self, f: &mut Formatter) -> FmtResult<()> {
44 self.0.fmt_display(f)
45 }
46 }
47}
48
49crate::items! { #[allow(unused)]
51 pub use _mods::*;
52
53 mod _mods {
54 pub use super::codegen::*;
55 }
56 pub(super) mod _all {
57 #[doc(inline)]
58 pub use super::_mods::*;
59 }
60}