pub struct TableBuilder<'a, Dates = Empty<NaiveDate>, DateFmt = &'static str, Additional = ()> { /* private fields */ }Expand description
Table builder.
Implementations§
Source§impl<'a> TableBuilder<'a>
impl<'a> TableBuilder<'a>
Sourcepub fn default(data: &'a AvailabilityData, target: &'a str) -> Self
pub fn default(data: &'a AvailabilityData, target: &'a str) -> Self
Initializes a table builder for given data and target.
By default list of dates is empty (which is probably not what you want), as is the first
cell in the table (which is probably what you want).
Source§impl<'a, Dates, DateFmt, Additional> TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates, DateFmt, Additional> TableBuilder<'a, Dates, DateFmt, Additional>
Sourcepub fn first_cell(self, first_cell: &impl ToString) -> Self
pub fn first_cell(self, first_cell: &impl ToString) -> Self
Sets the very first cell in the table (top-left corner).
Sourcepub fn dates<I>(
self,
dates: I,
) -> TableBuilder<'a, I::IntoIter, DateFmt, Additional>
pub fn dates<I>( self, dates: I, ) -> TableBuilder<'a, I::IntoIter, DateFmt, Additional>
Sets the dates range to a given iterator over dates.
Please note that the iterator (not your object, but rather the iterator it resolves to)
should be cloneable. If you provide a Vec, you are on the safe side :)
Sourcepub fn date_format<T>(
self,
date_fmt: T,
) -> TableBuilder<'a, Dates, T, Additional>
pub fn date_format<T>( self, date_fmt: T, ) -> TableBuilder<'a, Dates, T, Additional>
Sets a format in which the dates will be formatted. Here’s a formatting syntax for your convenience: chrono::format::strftime.
The default is "%Y-%m-%d".
Sourcepub fn additional<NewAdditional>(
self,
data: NewAdditional,
) -> TableBuilder<'a, Dates, DateFmt, NewAdditional>
pub fn additional<NewAdditional>( self, data: NewAdditional, ) -> TableBuilder<'a, Dates, DateFmt, NewAdditional>
Sets the additional data.
Trait Implementations§
Source§impl<'a, Dates: Clone, DateFmt: Clone, Additional: Clone> Clone for TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates: Clone, DateFmt: Clone, Additional: Clone> Clone for TableBuilder<'a, Dates, DateFmt, Additional>
Source§fn clone(&self) -> TableBuilder<'a, Dates, DateFmt, Additional>
fn clone(&self) -> TableBuilder<'a, Dates, DateFmt, Additional>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a, Dates, DateFmt, Additional> Freeze for TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates, DateFmt, Additional> RefUnwindSafe for TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates, DateFmt, Additional> Send for TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates, DateFmt, Additional> Sync for TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates, DateFmt, Additional> Unpin for TableBuilder<'a, Dates, DateFmt, Additional>
impl<'a, Dates, DateFmt, Additional> UnwindSafe for TableBuilder<'a, Dates, DateFmt, Additional>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more