Modules§
Macros§
Structs§
- Decode
Error - Encode
Error - Owned
Bytes Nested Decode Input - A nested decode buffer that owns its data.
- Vec
- Reexport needed by derive.
A contiguous growable array type, written as
Vec<T>, short for ‘vector’.
Traits§
- Decode
Default - Encode
Default - Nested
Decode - Trait that allows zero-copy read of value-references from slices in LE format.
- Nested
Decode Input - Trait that allows deserializing objects from a buffer.
- Nested
Encode - Trait that allows zero-copy write of value-references to slices in LE format.
- Nested
Encode NoErr - Most types will be encoded without any possibility of error. The trait is used to provide these implementations. This is currently not a substitute for implementing a proper TopEncode.
- Nested
Encode Output - Trait that allows appending bytes. Used especially by the NestedEncode trait to output data.
- TopDecode
- Trait that allows zero-copy read of values from an underlying API in big endian format.
- TopDecode
Input - Trait that abstracts away an underlying API for a top-level object deserializer. The underlying API can provide pre-parsed i64/u64 or pre-bundled boxed slices.
- TopEncode
- TopEncode
Output - Specifies objects that can receive the result of a TopEncode computation. in principle from NestedEncode performed on nested items.
- TryStatic
Cast - Use to transfer objects from one generic type to another, without the compiler being able to determine whether or not the two types are the same. The cast is statically dispatched.
Functions§
- boxed_
slice_ into_ vec - bytes_
to_ number - Handles both signed and unsigned of any length. No generics here, because we want the executable binary as small as possible.
- dep_
decode_ from_ byte_ slice - Convenience method, to avoid having to specify type when calling
dep_decode. Especially useful in the macros. Also checks that the entire slice was used. The input doesn’t need to be mutable because we are not changing the underlying data. - dep_
decode_ from_ byte_ slice_ or_ exit - dep_
encode_ to_ vec - Convenience function for getting an object nested-encoded to a Vec
directly. - top_
decode_ from_ nested - Top-decodes the result using the NestedDecode implementation.
- top_
decode_ from_ nested_ or_ exit - Top-decodes the result using the NestedDecode implementation. Uses the fast-exit mechanism in case of error.
- top_
encode_ from_ nested - top_
encode_ from_ nested_ or_ exit - top_
encode_ no_ err - Quick encoding of a type that never fails on encoding.
- top_
encode_ number_ to_ output - top_
encode_ to_ vec - try_
cast_ execute_ or_ else - try_
cast_ ref - try_
execute_ then_ cast - using_
encoded_ number - Adds number to output buffer. No argument generics here, because we want the executable binary as small as possible. Smaller types need to be converted to u64 before using this function. TODO: there might be a quicker version of this using transmute + reverse bytes.
- vec_
into_ boxed_ slice