The most complete serialization tree for [serde
].
[Save
] represents the entire serde data model,
including struct names, field names,
and enum variant information.
This means that it can intercept structures when they are serialized, before
losslessly forwarding them.
[Save
] can optionally persist errors in the serialization tree,
instead of short-circuiting.
This is a zero-cost option - see documentation on [Save::Error
] for more.
// These will fail to serialize
let before_unix_epoch = UNIX_EPOCH - from_secs;
let non_utf8_path = from;
let my_struct = MyStruct ;
// By default errors are short-circuiting
assert_eq!;
// But you can persist and inspect them in-tree if you prefer.
assert_eq!
[Serializer
] can also check for incorrect implementations of the serde protocol.
See the documentation on [Save
]s variants to see which invariants are checked.
You can configure this behaviour.