#rest #deserialize #capture #byte #retain #extract

serde-capture

'Skip' deserialisation, but extract some, and retain the rest for later

1 unstable release

0.1.0 Nov 14, 2019

#7 in #retain

MIT/Apache

4KB

serde-capture

Capture some part of a document during deserialisation, and store it serialised, instead of as a structure. This might use less memory.

This provides a:

pub struct CaptureJson<T> {
    pub inner: T,
    pub bytes: Box<[u8]>,
}

... which you can embed in your structure:

struct Doc {
    foo: Vec<CaptureJson<Nothing>>,
}

... which should be smaller than Vec<Value>, but with significantly slower access.

Dependencies

~0.7–1.6MB
~34K SLoC