Update documentation

This commit is contained in:
Tadeo Kondrak 2020-06-29 14:37:15 -06:00
parent 615f278f3f
commit 03db2ca246
No known key found for this signature in database
GPG Key ID: D41E092CA43F1D8B

View File

@ -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;