Crate multiversx_sc_codec

Source

Re-exports§

pub use arrayvec;

Modules§

codec_convert
multi_types
test_util

Macros§

dep_encode_num_mimic

Structs§

DecodeError
DefaultErrorHandler
The simplest error handler, it simply passes the error on.
Empty
Empty structure with an empty bytes representation. Equivalent to false, 0 or [u8; 0], but more explicit.
EncodeError
OwnedBytesNestedDecodeInput
A nested decode buffer that owns its data.
PanicErrorHandler
An error handler that panics immediately, instead of returning a Result.
Vec
Reexport needed by derive. A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Traits§

DecodeDefault
DecodeErrorHandler
EncodeDefault
EncodeErrorHandler
IntoMultiValue
Defines conversion of a type to its multi-value representation.
NestedDecode
Trait that allows zero-copy read of value-references from slices in LE format.
NestedDecodeInput
Trait that allows deserializing objects from a buffer.
NestedEncode
Trait that allows zero-copy write of value-references to slices in LE format.
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.
TopDecodeMulti
TopDecodeMultiInput
TopDecodeMultiLength
TopEncode
TopEncodeMulti
TopEncodeMultiOutput
TopEncodeOutput
Specifies objects that can receive the result of a TopEncode computation. in principle from NestedEncode performed on nested items.
TryStaticCast
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
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_encode_to_vec
Convenience function for getting an object nested-encoded to a Vec directly.
multi_encode_iter_or_handle_err
top_decode_from_nested
Top-decodes the result using the NestedDecode implementation.
top_decode_from_nested_or_handle_err
Top-decodes the result using the NestedDecode implementation.
top_encode_from_nested
top_encode_number
Encodes number to minimimum number of bytes (top-encoding).
top_encode_to_vec_u8
top_encode_to_vec_u8_or_panic
try_cast_execute_or_else
try_cast_ref
try_execute_then_cast
universal_decode_number
Handles both top-encoding and nested-encoding, signed and unsigned, of any length.
vec_into_boxed_slice