Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upStreaming? #254
Streaming? #254
Comments
|
What do you mean by streaming? Also, even if you managed to serialize the file via streaming, what would you do to deserialize it? |
|
I mean Reader/Writer, the ability to process in chunks. I assume that I would be able to use the |
|
are you serializing a bunch of smaller structs? Rust doesn't deal with uninitialized data very well, so having partially constructed structs isn't really possible. |
|
Not necessarily a bunch, it could be just one. One of the values in the struct will be the contents of a file though, which could be gigabytes, and might not always fit in memory all at once. I think I'm going to look into other methods of... chunked serialisation? I think flatbuffers might do it. |
|
Yeah, I don't think that Bincode can help you here. |
Is streaming possible with
bincode? It looks like all the serialisation functions have aSizedbound, but I'm fuzzy on how exactly this works.I need to serialise a struct that will sometimes be too large to hold in memory all at one time, because it will have a field that contains file data. The only way I can see around this is to use a BufReader so that bytes can be read as a stream, but BufReader does not derive
serde::Serialize.Thanks.