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
use crate::{Row, RowStruct, Table, TableStruct};
#[cfg_attr(
any(docsrs, feature = "doc"),
doc(cfg(any(feature = "title", feature = "derive")))
)]
pub trait Title {
fn title() -> RowStruct;
}
#[cfg_attr(
any(docsrs, feature = "doc"),
doc(cfg(any(feature = "title", feature = "derive")))
)]
pub trait WithTitle {
fn with_title(self) -> TableStruct;
}
impl<'a, T, R> WithTitle for T
where
T: IntoIterator<Item = &'a R>,
R: Title + 'static,
&'a R: Row,
{
fn with_title(self) -> TableStruct {
let table = self.table();
let title = R::title();
table.title(title)
}
}