pub struct DateSelector {
pub name: String,
pub has_time: bool,
/* private fields */
}Expand description
The interactive selector interface for date and time.
By default, DateSelector::new() returns a selector for date, NOT FOR date and time.
If you want to select date and time with a selector, set DateSelector.has_time true
before calling select() method.
An instance for the date selection must be mutable and the selected date (or datetime) can be extracted within different formats:
- DateSelector.get_date() ->
chrono::DateTime<Local> - DateSelector.to_string() -> String
use ttyui::selector::DateSelector;
let mut d = DateSelector::new();
d.has_time = true;
println!("selected: {}", d.select().unwrap().to_string());Fields§
§name: Stringdate name for the selection
has_time: boolwhether the selector supports time selection or not
Implementations§
Source§impl DateSelector
impl DateSelector
Trait Implementations§
Source§impl Clone for DateSelector
impl Clone for DateSelector
Source§fn clone(&self) -> DateSelector
fn clone(&self) -> DateSelector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DateSelector
impl Debug for DateSelector
Auto Trait Implementations§
impl Freeze for DateSelector
impl RefUnwindSafe for DateSelector
impl Send for DateSelector
impl Sync for DateSelector
impl Unpin for DateSelector
impl UnsafeUnpin for DateSelector
impl UnwindSafe for DateSelector
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