Skip to main content

to_wxf

Function to_wxf 

Source
pub fn to_wxf<T>(
    value: &T,
    compression: impl Into<Option<CompressionLevel>>,
) -> Result<Vec<u8>, Error>
where T: ToWXF + ?Sized,
Expand description

Serialize value to WXF.

compression is impl Into<Option<CompressionLevel>>: pass None for plain uncompressed WXF (8: header), or a CompressionLevel for zlib-compressed WXF (8C: header) — e.g. to_wxf(&v, None) or to_wxf(&v, CompressionLevel::Default).

The compressed path streams the token body directly through the ZlibEncoder — no intermediate uncompressed buffer.