docs: update to docs on codecs

This commit is contained in:
Dylan Bowker
2024-05-12 14:19:52 -06:00
committed by Vincent Herlemont
parent ac150841b0
commit b85d4ce554
+8 -6
View File
@@ -20,21 +20,22 @@
//! `native_model` comes with several optional built-in serializer features //! `native_model` comes with several optional built-in serializer features
//! available: //! available:
//! //!
//! - [bincode](https://crates.io/crates/bincode/1.3.3) `1.3` · This is the //! - [bincode 1.3](https://crates.io/crates/bincode/1.3.3) · This is the
//! default codec. **Warning: This codec may not work with all serde-derived //! default codec. **Warning: This codec may not work with all serde-derived
//! types.** //! types.**
//! //!
//! - [bincode](https://crates.io/crates/bincode/2.0.0-rc.3) `2.0.0-rc.3` · //! - [bincode 2.0.0-rc.3](https://crates.io/crates/bincode/2.0.0-rc.3) ·
//! Enable the `bincode_2_rc` feature and use the //! Enable the `bincode_2_rc` feature and use the
//! `native_model::bincode_2_rc::Bincode` attribute to have `native_db` use this //! `native_model::bincode_2_rc::Bincode` attribute to have `native_db` use this
//! crate. **Warning: This codec may not work with all serde-derived types.** //! crate for serializing & deserializing. **Warning: This codec may not work
//! with all serde-derived types.**
//! //!
//! - [postcard](https://crates.io/crates/postcard/1.0.8) `1.0` · //! - [postcard 1.0](https://crates.io/crates/postcard/1.0.8) ·
//! Enable the `postcard_1_0` feature and use the //! Enable the `postcard_1_0` feature and use the
//! `native_model::postcard_1_0::PostCard` attribute. **Warning: This codec may //! `native_model::postcard_1_0::PostCard` attribute. **Warning: This codec may
//! not work with all serde-derived types.** //! not work with all serde-derived types.**
//! //!
//! - [rmp-serde](https://crates.io/crates/rmp-serde/1.3.0) `1.3` · //! - [rmp-serde 1.3](https://crates.io/crates/rmp-serde/1.3.0) ·
//! Enable the `rmp_serde_1_3` feature and use the //! Enable the `rmp_serde_1_3` feature and use the
//! `native_model::rmp_serde_1_3::RmpSerde` attribute. //! `native_model::rmp_serde_1_3::RmpSerde` attribute.
//! //!
@@ -53,7 +54,8 @@
//! native_model = { version = "0.4", features = [ "rmp_serde_1_3" ] } //! native_model = { version = "0.4", features = [ "rmp_serde_1_3" ] }
//! ``` //! ```
//! //!
//! 2. Assign the `rmp_serde_1_3` codec to your type using the `with` attribute: //! 2. Assign the `rmp_serde_1_3` codec to your `struct` using the `with`
//! attribute:
//! //!
//! ```rust //! ```rust
//! #[derive(Clone, Default, serde::Deserialize, serde::Serialize)] //! #[derive(Clone, Default, serde::Deserialize, serde::Serialize)]