~tdeo/serde_bare

03db2ca246b1f162cf3fd8a40df292d79af61204 — Tadeo Kondrak 11 months ago 615f278
Update documentation
1 files changed, 7 insertions(+), 12 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +7 -12
@@ 1,27 1,22 @@
#![forbid(unsafe_code)]
//! # serde_bare
//!
//! An implementation of the BARE (https://git.sr.ht/~sircmpwn/bare) encoding format draft.
//!
//! ## `u8`/`u16`/`u32`/`u64`, `i8`/`i16`/`i32`/`i64`, `f32`/`f64`, `bool`, `string`, `data`, `optional`, `[]type`, `map`, and `struct`
//!
//! ## `u8`/`u16`/`u32`/`u64`, `i8`/`i16`/`i32`/`i64`, `f32`/`f64`, `bool`, `string`, `data`, `optional<type>`, `[]type`, `map`, and `struct`
//! Mapped exactly.
//!
//! ## `u128`, `i128`
//!
//! Encoded in the same fashion as the other integers, but the type is data<16>.
//!
//! ## `uint`, `int`, `enum`
//! [Uint] and [Int] types wrap a u64/i64 for these types. Uint can be used for `enum`.
//!
//! ## `[length]type`, `data<length>`
//! Can be used as a `[T; N]` where Serde has an implementation for it, or manually with deserialize_tuple.
//! `[T; N]`.
//!
//! ## `(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.  
//! Rust enums, with or without fields are represented as tagged unions in BARE.
//! If the enum has no fields, it can be represented as an integer with `serde_repr`.

pub mod de;
pub mod error;