XDR runtime encoding/decoding
This crate provides runtime support for encoding and decoding XDR data. It is intended to be used with code generated by the "xdrgen" crate, but it can also be used with hand-written code.
It provides two key traits -
Unpack - which all
encodable types must implement. It also provides the helper
unpack() to simplify the API.
By default, this does not implement codecs for
u8. This is because
encoding individual bytes is quite inefficient, as they're all padded up to
32 bits (4 bytes). This doesn't matter for individual items, but arrays of
bytes should be represented by opaque arrays (static size) or flex arrays
(dynamic size) (or strings for character data).
However, some protocols are mis-specified to use byte arrays (I'm looking at
you, gluster), so the option to support the exists. You can enable byte codec
XDR record marking
The Error type.
Wrapper for XDR opaque data.
The kind of an error.
Basic packing trait.
Additional methods for
Basic unpacking trait
A trait for objects which are byte-oriented sinks.
Serialization (packing) helper.
Pack a fixed-size array.
Pack a dynamically sized array, with size limit check.
Pack a fixed-size byte array
Pack a dynamically sized opaque array, with size limit check.
Pack a string with size limit check.
Compute XDR padding.
Deserialization (unpacking) helper function
Unpack a fixed-sized array
Unpack a (perhaps) length-limited array
Unpack a fixed-sized opaque array
Unpack a (perhaps) length-limited opaque array
Unpack (perhaps) length-limited string
Convenient wrapper around