pub struct Logfile(_);
Expand description

A Logfile type that wraps the timelog log file.

Implementations

Creates a Logfile object wrapping the supplied file.

Errors

Open the log file, return a File.

Errors

Clone the filename

Return true if the timelog file exists

Append the supplied line (including time stamp) to the timelog file

Errors

Append the supplied task to the timelog file

Errors
source

pub fn add_entry(&self, entry: &Entry) -> Result<(), PathError>

Append the supplied Entry to the timelog file

Errors

Add a comment line to the timelog file

Errors

Add a zero duration event to the timelog file

Errors

Remove the most recent task from the logfile.

source

pub fn reset_last_entry(&self) -> Result<(), Error>

Reset most recent entry to current date time.

source

pub fn ignore_last_entry(&self) -> Result<(), Error>

Ignore the most recent entry to current date time.

source

pub fn rewrite_last_entry(&self, task: &str) -> Result<(), Error>

Rewrite the text of the most recent entry.

Return the unfiltered last line of the timelog file or None if we can’t.

Return the last line of the timelog file or None if we can’t.

source

pub fn last_entry(&self) -> Result<Entry, Error>

Return the last line of the timelog file as an [`Entry’].

Errors

Return a Vec of problems found with the file.

If the Vec is empty, there are no problems.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.