pub enum DueSpec {
Absolute(Due),
TimeOnly(Time),
Weekday(Weekday),
}Expand description
An unresolved due-date value parsed from [...] title syntax (FR-34):
pure and reference-date-agnostic, since todoapp-core has no Clock
access (spec §5). DueSpec::resolve turns it into a concrete Due
once a caller (todoapp-app, which holds a Clock) supplies “today”.
Variants§
Absolute(Due)
TimeOnly(Time)
Weekday(Weekday)
Next occurrence of this weekday, strictly after today.
Implementations§
Source§impl DueSpec
impl DueSpec
Sourcepub fn parse(s: &str) -> Result<Self, String>
pub fn parse(s: &str) -> Result<Self, String>
Accepts anything Due::parse does (YYYY-MM-DD[ HH:MM]), a bare
HH:MM time, or a weekday name — the same relaxed grammar [...]
title syntax uses, shared with any other free-text due-date input
(TUI edit form, CLI --due).
pub fn resolve(&self, today: Date) -> Due
Trait Implementations§
impl Copy for DueSpec
impl Eq for DueSpec
impl StructuralPartialEq for DueSpec
Auto Trait Implementations§
impl Freeze for DueSpec
impl RefUnwindSafe for DueSpec
impl Send for DueSpec
impl Sync for DueSpec
impl Unpin for DueSpec
impl UnsafeUnpin for DueSpec
impl UnwindSafe for DueSpec
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