facet-xdr
XDR (External Data Representation) format support via facet-format.
XDR is a binary format defined in RFC 4506 for encoding structured data. It is primarily used in Sun RPC (ONC RPC) protocols.
Key characteristics:
- Big-endian byte order
- Fixed-size integers (4 bytes for i32/u32, 8 bytes for i64/u64)
- No support for i128/u128
- Strings are length-prefixed with 4-byte aligned padding
- Arrays have explicit length prefixes
Serialization
use Facet;
use to_vec;
let point = Point ;
let bytes = to_vec.unwrap;
Deserialization
use Facet;
use from_slice;
// XDR encoding of Point { x: 10, y: 20 }
let bytes = &;
let point: Point = from_slice.unwrap;
assert_eq!;
assert_eq!;