Trait libimagentrydatetime::datetime::EntryDate [] [src]

pub trait EntryDate {
    fn delete_date(&mut self) -> Result<()>;
fn read_date(&self) -> Result<NaiveDateTime>;
fn set_date(
        &mut self,
        d: NaiveDateTime
    ) -> Result<Option<Result<NaiveDateTime>>>;
fn delete_date_range(&mut self) -> Result<()>;
fn read_date_range(&self) -> Result<DateTimeRange>;
fn set_date_range(
        &mut self,
        start: NaiveDateTime,
        end: NaiveDateTime
    ) -> Result<Option<Result<DateTimeRange>>>; }

Required Methods

Implementations on Foreign Types

impl EntryDate for Entry
[src]

[src]

[src]

[src]

Set a Date for this entry

Return value

This function returns funny things, I know. But I find it more attractive to be explicit what failed when here, instead of beeing nice to the user here.

So here's a list how things are returned:

  • Err(_) if the inserting failed
  • Ok(None) if the inserting succeeded and did not replace an existing value.
  • Ok(Some(Ok(_))) if the inserting succeeded, but replaced an existing value which then got parsed into a NaiveDateTime object
  • Ok(Some(Err(_))) if the inserting succeeded, but replaced an existing value which then got parsed into a NaiveDateTime object, where the parsing failed for some reason.

[src]

Deletes the date range

Warning

First deletes the start, then the end. If the first operation fails, this might leave the header in an inconsistent state.

[src]

[src]

Set the date range

Warning

This first sets the start, then the end. If the first operation fails, this might leave the header in an inconsistent state.

Implementors