Closed hedgar2017 closed 3 months ago
Can you provide a complete example?
@VictorKoenders of course!
The main
function:
fn main() {
let candle = rust_decimal::Decimal::new(1, 0);
let serialized = bincode::serialize(&candle).unwrap();
let deserialized: rust_decimal::Decimal = bincode::deserialize(serialized.as_slice()).unwrap();
dbg!(&deserialized);
}
The dependencies:
rust_decimal = "1.34"
bincode = "1.3"
The panic message (of bincode::deserialize
):
thread 'main' panicked at downloader/src/bug.rs:4:91:
called `Result::unwrap()` on an `Err` value: DeserializeAnyNotSupported
Looks like you need to enable a specific feature in rust_decimal
: https://github.com/paupino/rust-decimal/blob/master/src/serde.rs#L707-L721
Looks like you need to enable a specific feature in
rust_decimal
: https://github.com/paupino/rust-decimal/blob/master/src/serde.rs#L707-L721
Thanks, will try.
Just FYI, I'm getting
DeserializedAnyNotSupported
for aVecDeque
of simple trading chart candlesticks.Basically, I cannot deserialize the same object I've just serialized.