[][src]Crate elrond_codec

Modules

test_util

Structs

DecodeError
EncodeError

Traits

NestedDecode

Trait that allows zero-copy read of value-references from slices in LE format.

NestedDecodeInput

Trait that allows reading of data into a slice.

NestedEncode

Trait that allows zero-copy write of value-references to slices in LE format.

NestedEncodeNoErr

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.

NestedEncodeOutput

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.

TopDecodeInput

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
TopEncodeOutput

Specifies objects that can receive the result of a TopEncode computation. in principle from NestedEncode performed on nested items.

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_slice_contents

Adds the concantenated encoded contents of a slice to an output buffer, without serializing the slice length. Byte slice is treated separately, via direct transmute.

dep_encode_slice_contents_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_number_to_output
top_encode_to_vec
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