revision/implementations/
mod.rs

1pub mod arc;
2pub mod arrays;
3pub mod bound;
4pub mod boxes;
5pub mod bytes;
6pub mod chrono;
7pub mod collections;
8pub mod cow;
9pub mod decimal;
10pub mod duration;
11pub mod geo;
12pub mod imbl;
13pub mod notnan;
14pub mod option;
15pub mod path;
16pub mod primitives;
17pub mod regex;
18pub mod result;
19pub mod reverse;
20pub mod roaring;
21pub mod specialised;
22pub mod string;
23pub mod tuple;
24pub mod uuid;
25pub mod vecs;
26pub mod wrapping;
27
28#[cfg(test)]
29#[track_caller]
30pub fn assert_bincode_compat<T>(v: &T)
31where
32	T: serde::Serialize + crate::SerializeRevisioned,
33{
34	use bincode::Options;
35
36	#[cfg(feature = "fixed-width-encoding")]
37	let bincode = bincode::options()
38		.with_no_limit()
39		.with_little_endian()
40		.with_fixint_encoding()
41		.reject_trailing_bytes()
42		.serialize(&v)
43		.unwrap();
44
45	#[cfg(not(feature = "fixed-width-encoding"))]
46	let bincode = bincode::options()
47		.with_no_limit()
48		.with_little_endian()
49		.with_varint_encoding()
50		.reject_trailing_bytes()
51		.serialize(&v)
52		.unwrap();
53
54	let mut revision = Vec::new();
55	v.serialize_revisioned(&mut revision).unwrap();
56
57	assert_eq!(revision, bincode)
58}