jmap_client/thread/
mod.rs1pub mod get;
13pub mod helpers;
14
15use std::fmt::Display;
16
17use serde::{Deserialize, Serialize};
18
19use crate::core::{changes::ChangesObject, Object};
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct Thread {
23 id: String,
24 #[serde(rename = "emailIds")]
25 email_ids: Vec<String>,
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Copy)]
29pub enum Property {
30 #[serde(rename = "id")]
31 Id,
32 #[serde(rename = "emailIds")]
33 EmailIds,
34}
35
36impl Object for Thread {
37 type Property = Property;
38
39 fn requires_account_id() -> bool {
40 true
41 }
42}
43
44impl Display for Property {
45 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
46 match self {
47 Property::Id => write!(f, "id"),
48 Property::EmailIds => write!(f, "emailIds"),
49 }
50 }
51}
52
53impl ChangesObject for Thread {
54 type ChangesResponse = ();
55}