diff --git a/_skeptic/Cargo.toml b/_skeptic/Cargo.toml index a301f3a7..fc029ae2 100644 --- a/_skeptic/Cargo.toml +++ b/_skeptic/Cargo.toml @@ -18,5 +18,6 @@ serde_repr = "0.1" serde_test = "1.0" serde-transcode = "1.0" serde_yaml = "0.8" +serde_bytes = "0.11" skeptic = "0.13" void = "1.0" diff --git a/_src/field-attrs.md b/_src/field-attrs.md index d0a2b984..602415c8 100644 --- a/_src/field-attrs.md +++ b/_src/field-attrs.md @@ -85,6 +85,18 @@ `$module::serialize` as the `serialize_with` function and `$module::deserialize` as the `deserialize_with` function. +```rust +// For some iter types custom module might significantly improve performance, +// for instance `Vec` ser/deserialized about 10x times faster with serde_bytes +# use serde::{Serialize, Deserialize}; +#[derive(Serialize, Deserialize)] +struct Fast { + #[serde(with = "serde_bytes")] + buf: Vec +} +# fn main() {} +``` + - ##### `#[serde(borrow)]` and `#[serde(borrow = "'a + 'b + ...")]` {#borrow} Borrow data for this field from the deserializer by using zero-copy