1use crate::{Row, RowStruct, Table, TableStruct};
2
3#[cfg_attr(
5 any(docsrs, feature = "doc"),
6 doc(cfg(any(feature = "title", feature = "derive")))
7)]
8pub trait Title {
9 fn title() -> RowStruct;
11}
12
13#[cfg_attr(
15 any(docsrs, feature = "doc"),
16 doc(cfg(any(feature = "title", feature = "derive")))
17)]
18pub trait WithTitle {
19 fn with_title(self) -> TableStruct;
21}
22
23impl<'a, T, R> WithTitle for T
24where
25 T: IntoIterator<Item = &'a R>,
26 R: Title + 'static,
27 &'a R: Row,
28{
29 fn with_title(self) -> TableStruct {
30 let table = self.table();
31 let title = R::title();
32 table.title(title)
33 }
34}