diff --git a/src/lib.rs b/src/lib.rs index 7609bd8..3a5440e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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`, `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` -//! 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;