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)
}
}