[−][src]Crate cookie_factory
serialization library built with a combinator design similar to nom.
Serializers are built up from single purpose serializers, like slice
to write a raw byte slice, or be_u16
to write a u16
integer in big
endian form.
Those small serializers can then be assembled by using combinators.
As an example, all(["abcd", "efgh", "ijkl"].iter().map(string))(output)
will write "abcdefghijkl"
to output
.
Modules
lib | lib module necessary to reexport what we need from std in |
Macros
do_gen | Applies sub-generators in a sequence. |
gen_align |
|
gen_at_offset |
|
gen_at_rel_offset |
|
gen_be_f32 |
|
gen_be_f64 |
|
gen_be_i8 |
|
gen_be_i16 |
|
gen_be_i24 |
|
gen_be_i32 |
|
gen_be_i64 |
|
gen_be_u8 |
|
gen_be_u16 |
|
gen_be_u24 |
|
gen_be_u32 |
|
gen_be_u64 |
|
gen_call | Used to wrap common expressions and function as macros |
gen_cond |
|
gen_copy |
|
gen_if_else |
|
gen_le_f32 |
|
gen_le_f64 |
|
gen_le_i8 |
|
gen_le_i16 |
|
gen_le_i24 |
|
gen_le_i32 |
|
gen_le_i64 |
|
gen_le_u8 |
|
gen_le_u16 |
|
gen_le_u24 |
|
gen_le_u32 |
|
gen_le_u64 |
|
gen_length_slice | |
gen_many |
|
gen_many_byref |
|
gen_many_ref |
|
gen_skip |
|
gen_slice |
|
Enums
GenError | Base type for generator errors |
Traits
GenChain | |
Length | |
SerializeFn | |
Skip |
Functions
all | applies an iterator of serializers |
be_f32 | |
be_f64 | |
be_i8 | |
be_i16 | |
be_i24 | |
be_i32 | |
be_i64 | |
be_u8 | |
be_u16 | |
be_u24 | |
be_u32 | |
be_u64 | |
cond | applies a serializer if the condition is true |
hex | writes an hex string to the output |
le_f32 | |
le_f64 | |
le_i8 | |
le_i16 | |
le_i24 | |
le_i32 | |
le_i64 | |
le_u8 | |
le_u16 | |
le_u24 | |
le_u32 | |
le_u64 | |
legacy_wrap | |
many_ref | applies a generator over an iterator of values, and applies the serializers generated |
pair | applies 2 serializers in sequence |
position | applies a serializer then returns a tuple containing what was written and the remaining output buffer |
separated_list | applies an iterator of serializers |
set_be_u8 | Write an unsigned 1 byte integer. Equivalent to |
set_be_u16 | Write an unsigned 2 bytes integer (big-endian order). Equivalent to |
set_be_u32 | Write an unsigned 4 bytes integer (big-endian order). Equivalent to |
set_be_u64 | Write an unsigned 8 bytes integer (big-endian order). Equivalent to |
set_le_u8 | Write an unsigned 1 byte integer. Equivalent to |
set_le_u16 | Write an unsigned 2 bytes integer (little-endian order). Equivalent to |
set_le_u32 | Write an unsigned 4 bytes integer (little-endian order). Equivalent to |
set_le_u64 | Write an unsigned 8 bytes integer (little-endian order). Equivalent to |
skip | skips over some input bytes |
slice | writes a byte slice to the output |
string | writes a byte slice to the output |
Type Definitions
GenResult |