Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

CBOR format support #46

Closed
Boscop opened this issue Mar 11, 2018 · 2 comments
Closed

CBOR format support #46

Boscop opened this issue Mar 11, 2018 · 2 comments
Labels

Comments

@Boscop
Copy link

Boscop commented Mar 11, 2018

When I deserialize my struct from binary with bincode after adding a field to the struct, it cant deserialize the struct, losing my old data (the other struct fields that stayed the same since the last session).
Apparently, this can be fixed by using a different format that includes field names.
I tried yaml but it takes a long time to serialize/deserialize and the file is very large (for my use case).
Out of all the formats that include field names, CBOR (which serde supports) is the one that should be fastest to (de)serialize and should have the lowest file size because it's binary.
Would it be possible to add CBOR support to rustbreak? :)

Btw, my use case is persistence of data of my application and the structs change between sessions, sometimes fields are added/removed and I want to always load as much data as possible from the previous session (using #[serde(default)] on the struct to use Default::default() on a field granularity level to initialize new fields that aren't in the persisted data).

@TheNeikos
Copy link
Owner

Hm, that could be added, however I do not want to invest too much time into v1, since it is somewhat clumsy in my opinion.

For v2 I've majorly redesigned how the whole ser/de works. Would you mind taking a look?

@TheNeikos TheNeikos added the v1 label May 10, 2018
@TheNeikos
Copy link
Owner

This is outdated by now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants