use crate::context::LocalOrUTC;
use crate::Context;
pub trait DisplayConfig: Sized {
fn context_mut(&mut self) -> &mut Context;
fn verbose(mut self) -> Self {
self.context_mut().verbose = Some(true);
self
}
fn limit_items(mut self, max_items: usize) -> Self {
self.context_mut().max_items = Some(max_items);
self
}
fn use_local_time(mut self) -> Self {
self.context_mut().local_or_utc = Some(LocalOrUTC::Local);
self
}
fn use_utc_time(mut self) -> Self {
self.context_mut().local_or_utc = Some(LocalOrUTC::Utc);
self
}
fn use_short_time(mut self) -> Self {
self.context_mut().time_format = Some("SIMPLE");
self
}
fn use_full_time(mut self) -> Self {
self.context_mut().time_format = Some("FULL");
self
}
fn with_time_format(mut self, time_format: &'static str) -> Self {
self.context_mut().time_format = Some(time_format);
self
}
}