cookie_factory/
lib.rs

1//! serialization library built with a combinator design similar to nom.
2//!
3//! Serializers are built up from single purpose serializers, like `slice`
4//! to write a raw byte slice, or `be_u16` to write a `u16` integer in big
5//! endian form.
6//!
7//! Those small serializers can then be assembled by using combinators.
8//! As an example, `all(["abcd", "efgh", "ijkl"].iter().map(string))(output)`
9//! will write `"abcdefghijkl"` to `output`.
10#![cfg_attr(not(feature = "std"), no_std)]
11
12#[cfg(not(feature = "std"))]
13mod io_compat;
14
15/// lib module necessary to reexport what we need from std in `no_std` mode
16pub mod lib {
17    #[cfg(feature = "std")]
18    pub mod std {
19        pub mod io {
20            pub use std::io::{Cursor, Error, Result, Seek, SeekFrom, Write};
21        }
22        pub use std::{cmp, fmt, iter, mem, result, slice};
23    }
24
25    #[cfg(not(feature = "std"))]
26    pub mod std {
27        pub use core::{cmp, iter, mem, result, slice};
28        #[macro_use]
29        pub use core::fmt;
30
31        pub mod io {
32            pub use crate::io_compat::*;
33        }
34    }
35}
36
37#[macro_use]
38pub mod gen;
39
40mod internal;
41pub use internal::*;
42#[cfg(feature = "async")]
43pub mod async_bufwriter;
44pub mod bytes;
45pub mod combinator;
46pub mod multi;
47pub mod sequence;