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
//! Custom save/load modules for use with the `#[automorph(with = "...")]` attribute.
//!
//! These modules provide custom serialization logic for types that don't
//! directly implement [`Automorph`](crate::Automorph).
//!
//! # Example
//!
//! ```rust
//! # #[cfg(feature = "chrono")]
//! # {
//! use automorph::Automorph;
//! use automerge::AutoCommit;
//! use chrono::{DateTime, Utc};
//!
//! #[derive(Automorph)]
//! struct Event {
//! name: String,
//!
//! #[automorph(with = "automorph::chrono_iso8601")]
//! timestamp: DateTime<Utc>,
//! }
//!
//! fn main() {
//! let mut doc = AutoCommit::new();
//! let event = Event { name: "test".to_string(), timestamp: Utc::now() };
//! event.save(&mut doc, automerge::ROOT, "event").unwrap();
//! }
//! # }
//! ```
//!
//! # Available Modules
//!
//! | Feature | Module | Type |
//! |---------|--------|------|
//! | `chrono` | [`chrono_iso8601`](crate::chrono_iso8601) | `DateTime<Utc>` |
//! | `uuid` | [`uuid_string`](crate::uuid_string) | `Uuid` |