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:
int:
i64 or
i32 or
u32
- 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
Since cypher core types are isomorphic to JSON, it should be doable to implement something like
#[derive(Serialize, Deserialize)]forBoltType.The core types have pretty obvious translations.
ByteArray:Bytesor[u8]orVec<u8>int:i64ori32oru32(notable, maybe no
u64forintsince 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 tostd::timeor an optionalchronodependency.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