pub struct Entry { /* private fields */ }Expand description
Representation of an entry in the log
Objects of this type represent individual lines in the timelog.txt file.
Each Entry has a date and time stamp, an optional project, and a task.
Implementations
sourceimpl Entry
impl Entry
sourcepub fn task_breakdown(entry_text: &str) -> (Option<String>, Option<String>)
pub fn task_breakdown(entry_text: &str) -> (Option<String>, Option<String>)
Parse the entry line text into the task name and detail parts if they exist.
sourcepub fn is_stop_line(line: &str) -> bool
pub fn is_stop_line(line: &str) -> bool
Return true if the supplied string looks like a stop line.
sourcepub fn datetime_from_line(line: &str) -> Option<&str>
pub fn datetime_from_line(line: &str) -> Option<&str>
Extract a date/time string from a task line
sourcepub fn date_from_line(line: &str) -> Option<&str>
pub fn date_from_line(line: &str) -> Option<&str>
Extract a date string from a task line
sourcepub fn extract_year(line: &str) -> Option<u32>
pub fn extract_year(line: &str) -> Option<u32>
Return the year for the supplied entry line, if any.
sourcepub fn is_comment_line(line: &str) -> bool
pub fn is_comment_line(line: &str) -> bool
Return true if the supplied line is a comment.
sourceimpl Entry
impl Entry
sourcepub fn new(entry_text: &str, time: DateTime) -> Self
pub fn new(entry_text: &str, time: DateTime) -> Self
Create a new Entry representing the supplied task at the supplied time.
sourcepub fn new_marked(entry_text: &str, time: DateTime, kind: EntryKind) -> Self
pub fn new_marked(entry_text: &str, time: DateTime, kind: EntryKind) -> Self
Create a new Entry representing the supplied task at the supplied time and optional
mark.
sourcepub fn from_line(line: &str) -> Result<Self, EntryError>
pub fn from_line(line: &str) -> Result<Self, EntryError>
Create a new Entry representing the entry from the supplied line.
This entry must be formatted as described in Format.md.
Errors
Return an EntryError if the line is empty or formatted incorrectly.
Trait Implementations
sourceimpl PartialOrd<Entry> for Entry
impl PartialOrd<Entry> for Entry
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Eq for Entry
impl StructuralEq for Entry
impl StructuralPartialEq for Entry
Auto Trait Implementations
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnwindSafe for Entry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more