You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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] or
Vec<u8>
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
The text was updated successfully, but these errors were encountered:
elimirks
changed the title
Derive macro for implement TryFrom/TryInto for BoltType
Derive macro for implementing TryFrom/TryInto for BoltTypeApr 9, 2025
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
:Bytes
or[u8]
orVec<u8>
int
:i64
ori32
oru32
(notable, maybe no
u64
forint
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 tostd::time
or an optionalchrono
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
The text was updated successfully, but these errors were encountered: