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
34
35
36
37
38
39
40
41
42
43
44
45
pub use Job;
/// Bidirectional conversion between a Rust struct and Redis-friendly
/// `Vec<(String, redis::Value)>` pairs.
///
/// Typically derived via `#[derive(Job)]` rather than implemented
/// by hand. The derive macro generates all three methods plus `From`/`TryFrom`
/// impls for seamless integration with Redis Streams (`XADD` / `XREADGROUP`).
///
/// # Example
///
/// ```rust,ignore
/// #[derive(Debug, Job)]
/// struct Email {
/// url: String,
/// priority: u8,
/// #[mapper(serialize = "ser_tags", deserialize = "de_tags")]
/// tags: Vec<String>,
/// }
///
/// let email = Email { url: "https://example.com".into(), priority: 1, tags: vec![] };
/// let pairs = email.try_to_pairs().unwrap();
/// let restored = Email::try_from_pairs(&pairs).unwrap();
/// ```