Description
Since cypher core types are isomorphic to JSON, it should be doable to implement something like #[derive(Serialize, Deserialize)]
for BoltType
.
The core types have pretty obvious translations.
ByteArray
:
Bytes
or[u8]
orVec<u8>
int
:
i64
ori32
oru32
- etc etc
(notable, maybe no u64
for int
since the JVM doesn't support u64, so I assume Neo4j doesn't either)
Spatial and graph types have less obvious translations into Rust, and maybe we could have a "sub-derive" similar to #[serde(serialize_with = ...)]
. Temporal types can like likely map to std::time
or an optional chrono
dependency.
I'm writing this here because it's something my team talked about implementing internally, but thought it would make since to contribute to the OSS project. It's not super high priority for us but we want to eventually implement it.
Let me know if this makes more sense as a separate crate