Crates.io | serde-intern |
lib.rs | serde-intern |
version | 1.0.0 |
source | src |
created_at | 2024-08-08 01:33:56.896278 |
updated_at | 2024-08-08 01:33:56.896278 |
description | A Serde addon that allows interning of strings and byte sequences behind `Arc`s during deserialization. |
homepage | |
repository | https://github.com/listochkin/serde-intern |
max_upload_size | |
id | 1328947 |
size | 26,417 |
A Serde addon that allows interning of strings and byte
sequences behind Arc
s during deserialization.
Serde comes with an "rc"
feature flag
already.
However:
Deserializing a data structure containing reference-counted pointers will not attempt to deduplicate references to the same data. Every deserialized pointer will end up with a strong count of 1.
Unlike the stock Rc
/ Arc
deserialization available in the main Serde crate,
these custom deserializer functions will find duplicate values and
instead of wrapping each of them into an individual Arc
it will reuse
the existing arcs.
See API documentation for more information.
Licensed under either of BSD-2-Clause Plus Patent License, or Apache License, Version 2.0, or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in serde-intern
by you, as defined in the Apache-2.0 license,
shall be multi-licensed as above, without any additional terms or conditions.