pub trait GPSEntry {
    fn set_coordinates(&mut self, c: Coordinates) -> Result<()>;
    fn get_coordinates(&self) -> Result<Option<Coordinates>>;
    fn remove_coordinates(&mut self) -> Result<Option<Result<Coordinates>>>;
}

Required Methods

Remove the coordinates from the entry

Returns

The return type is a bit complicated, but that has a reason:

The outer Result<> is used for notifying a failure during the header read/write action. If the Option<> is Some(), the value was deleted. The inner Result<> is used for parsing failures during the parsing of the deleted value.

So:

  • Ok(Some(Ok(_))) if the coordinates were deleted, returning the deleted value
  • Ok(Some(Err(_))) if the coordinates were deleted, but the deleted value couldn’t be parsed
  • Ok(None) if there were no coordinates to delete
  • Err(e) if the deleting failed

Implementations on Foreign Types

source

impl GPSEntry for Entry

Implementors