wolfram-serialize
Serialize and deserialize Wolfram Language expressions to and from the WXF (Wolfram Exchange Format) binary wire format.
Features
- Streaming, zero-copy — the
Reader/Writertraits provide a byte-level abstraction;SliceReaderreads straight out of an in-memory&[u8].FromWXF<'de>borrows from the input buffer wherever possible. - Typed traits — implement
ToWXF/FromWXFon your own types; derive them with#[derive(ToWXF)]/#[derive(FromWXF)]. - Compression — pass a
CompressionLeveltoto_wxfto write compressed payloads (8C:header);from_wxfdecompresses automatically. - Numeric widening — integers and reals widen to the closest Rust type without error.
- Failure derive —
#[derive(Failure)]maps a Rust error enum to aFailure["VariantName", <|...|>]expression for structured kernel errors.
Quick start
[]
= "0.6"
use ;
let p = Point ;
let bytes = to_wxf.unwrap;
let p2: Point = from_wxf.unwrap;
assert_eq!;
Changelog
See docs/CHANGELOG.md.