~tdeo/serde_bare

ref: fdf8d3f7cf11483ef5c50c54d7589ae9c4054c2a serde_bare/src/lib.rs -rw-r--r-- 1.1 KiB
fdf8d3f7Tadeo Kondrak Accept non-1 bools 1 year, 1 month 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
27
28
29
30
31
#![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`
//!
//! Mapped exactly.
//!
//! ## `[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;
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};