~tdeo/serde_bare

ref: 04278d356057e5b8c345428139dfeca75a858e4b serde_bare/src/lib.rs -rw-r--r-- 1.2 KiB
04278d35Tadeo Kondrak Improve documentation 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#![forbid(unsafe_code)]
//! # serde_bare
//!
//! 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.

pub mod de;
pub mod error;
pub mod ser;

#[doc(inline)]
pub use de::{from_reader, from_slice, Deserializer};
#[doc(inline)]
pub use error::{Error, Result};
#[doc(inline)]
pub use ser::{to_vec, to_writer, Serializer};