~tdeo/serde_bare

3167718e3a547c8fabb63b03e147e7d31adedb5a — Tadeo Kondrak 1 year, 4 months ago 04278d3
Fix markdown formatting
1 files changed, 19 insertions(+), 10 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +19 -10
@@ 3,16 3,25 @@
//!
//! An implementation of the BARE (https://git.sr.ht/~sircmpwn/bare) encoding format draft.
//!
//! Notes:
//!     - u8/u16/u32/u64, i8/i16/i32/i64, f32/f64, bool, string, data, optional, []type, map, and struct are mapped exactly.
//!     - e8/e16/e32/e64 have the same representation as the unsigned types.
//!     - Rust enums are serialized as { u32, fields } by default.
//!         - For enums without fields, this can be derived differently with `serde_repr`.
//!         - For enums with fields, this can be overridden with { uN, struct } representation or with a custom Deserialize implementation.
//!     - [length]type, data<length>
//!         - Can be used as a [T; N] where Serde has an implementation for it, or manually with deserialize_tuple.
//!     - (type | type | ...)
//!         - Cannot be derived as an enum directly, but can be a derived { u8, T } or a custom Deserialize implementation on an enum.
//! ## `u8`/`u16`/`u32`/`u64`, `i8`/`i16`/`i32`/`i64`, `f32`/`f64`, `bool`, `string`, `data`, `optional`, `[]type`, `map`, and `struct`
//!
//! Mapped exactly.
//!
//! ## `e8`/`e16`/`e32`/`e64`
//!
//! These have the same representation as the unsigned integer types.
//!
//! ## `[length]type`, `data<length>`
//! Can be used as a `[T; N]` where Serde has an implementation for it, or manually with deserialize_tuple.
//!
//! ## `(type | type | ...)`
//! Cannot be derived as an enum directly, but can be a derived `{ u8, T }` or a custom Deserialize implementation on an enum.
//!
//! ## Enum representation
//!
//! Rust enums are serialized as `{ u32, fields }` by default.  
//! For enums without fields, this can be derived differently with `serde_repr`.  
//! For enums with fields, this can be overridden with `{ uN, struct }` representation or with a custom Deserialize implementation.  

pub mod de;
pub mod error;