term_keep 1.1.0

Terminal-based Google Keep clone. Can be used as a note taking / To-Do list app on a server.
pub trait FromSqlRow: Sized {
  fn from_row(row: &rusqlite::Row) -> Result<Self, rusqlite::Error>;
}

pub trait ModelName {
  fn model_name() -> String;
}

pub trait RequireId: ModelName {
  fn option_id(&self) -> Option<u32>;

  #[allow(clippy::panic)]
  fn require_id(&self) -> u32 {
    RequireId::option_id(self)
      .unwrap_or_else(|| panic!("ID is not present in this {} instance", Self::model_name()))
  }
}