Store changing message data in single object

This commit is contained in:
mdecimus
2025-03-12 11:59:41 +01:00
parent d3b284e28d
commit 9491071731
35 changed files with 888 additions and 951 deletions

View File

@@ -39,7 +39,7 @@ pub const OTHER: usize = 12;
serde::Serialize,
)]
#[serde(untagged)]
#[rkyv(derive(PartialEq))]
#[rkyv(derive(PartialEq), compare(PartialEq))]
pub enum Keyword {
#[serde(rename(serialize = "$seen"))]
Seen,
@@ -300,24 +300,6 @@ impl From<&Keyword> for TagValue<u32> {
}
}
impl From<Keyword> for TagValue<MaybeDynamicId> {
fn from(value: Keyword) -> Self {
match value.into_id() {
Ok(id) => TagValue::Id(MaybeDynamicId::Static(id)),
Err(string) => TagValue::Text(string.into_bytes()),
}
}
}
impl From<&Keyword> for TagValue<MaybeDynamicId> {
fn from(value: &Keyword) -> Self {
match value.id() {
Ok(id) => TagValue::Id(MaybeDynamicId::Static(id)),
Err(string) => TagValue::Text(string.into_bytes()),
}
}
}
impl From<&ArchivedKeyword> for TagValue<MaybeDynamicId> {
fn from(value: &ArchivedKeyword) -> Self {
match value.id() {