1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::error::*;
use serde_derive::{Deserialize, Serialize};
#[derive(Debug, Clone, Hash, PartialEq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TabsRecordTab {
pub title: String,
pub url_history: Vec<String>,
pub icon: Option<String>,
pub last_used: u64,
}
#[derive(Debug, Clone, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TabsRecord {
pub id: String,
pub client_name: String,
pub tabs: Vec<TabsRecordTab>,
#[serde(default)]
pub ttl: u32,
}
impl TabsRecord {
#[inline]
pub fn from_payload(payload: sync15::Payload) -> Result<Self> {
let record: TabsRecord = payload.into_record()?;
Ok(record)
}
}