add more ser and de impls

This commit is contained in:
dignifiedquire
2020-02-11 23:22:55 +01:00
committed by holger krekel
parent beb91271de
commit 9cc99ffcd6
6 changed files with 491 additions and 513 deletions

View File

@@ -28,7 +28,9 @@ use crate::stock::StockMessage;
///
/// Some chat IDs are reserved to identify special chat types. This
/// type can represent both the special as well as normal chats.
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[derive(
Debug, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Hash, PartialOrd, Ord,
)]
pub struct ChatId(u32);
impl ChatId {
@@ -414,7 +416,7 @@ impl rusqlite::types::FromSql for ChatId {
/// Chat objects are created using eg. `Chat::load_from_db`
/// and are not updated on database changes;
/// if you want an update, you have to recreate the object.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Chat {
pub id: ChatId,
pub typ: Chattype,