-
-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 128bit integers #236
Comments
Hmm actually, if we wanted to do something with an explicit impl Serializer {
#[cfg(feature = "i128")]
fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
// use `byteorder` to serialize our value
}
serde_if_integer128! {
#[cfg(not(feature = "i128"))]
fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
let _ = v;
Err(Error::custom("i128 is not supported. Enable the `i128` feature of `bincode`"))
}
...
}
} So that enabling it always tried to implement the method, but if it's available and not implemented then we suggest the feature. |
This looks like a good plan! Would you feel comfortable implementing it? If not, I can get to it later this week. |
@TyOverby Sure! I'm happy to submit a PR for this. |
Hi @TyOverby! Are you happy to push out a |
Published! |
serde
1.0.62
1.0.60
was recently released with optional support for 128bit numbers. It would be good if we could wire them up tobincode
. There's a convenientserde_if_integer128!
macro thatserde
exposes we could use to automatically detect newer compilers, but that might not line up so well withbyteorder
's expliciti128
feature. Maybe we could do something like this:In
Cargo.toml
:In
ser.rs
orde.rs
:so that vanilla
bincode
keeps working on older compilers, but has a more helpful error message if you accidentally use 128bit numbers without enabling the feature?Or maybe we could work around it using some
build.rs
wizardry?The text was updated successfully, but these errors were encountered: