Skip to main content

Crate wolfram_serialize_macros

Crate wolfram_serialize_macros 

Source
Expand description

Procedural macros for wolfram-serializer.

Provides #[derive(ToWXF)] and #[derive(FromWXF)] for structs (named, tuple, unit) and enums. Field-level type pattern matching emits the correct WXF representation for Vec<u8> (ByteArray), Vec<numeric> and rectangular nested tuples / fixed-size arrays of numerics (NumericArray), while everything else delegates through the ToWXF / FromWXF traits.

See the wolfram-serializer crate docs for usage and the wire-format conventions emitted here.

Derive Macrosยง

Failure
Derive From<Enum> for Expr for an error enum: each variant becomes its Failure["VariantName", <|fields|>] expression (the expr! boilerplate one would otherwise write by hand, inferred from the enum).
FromWXF
Derive FromWXF for a struct or enum.
ToWXF
Derive ToWXF for a struct or enum.