pub fn parse_payload(
payload: &[u8],
format: PayloadFormat,
) -> Result<Value, ParseError>Available on crate feature
worker-batch and (crate features worker-batch or worker-pool or worker) only.Expand description
Parse raw bytes into a sonic_rs::Value using SIMD acceleration.
§Format dispatch
| Format | Engine |
|---|---|
Json | sonic_rs::from_slice (SIMD) |
Auto | byte-sniff -> Json or MsgPack |
MsgPack | rmpv native decode -> sonic_rs::Value walker (requires worker-msgpack feature) |
§Errors
Returns ParseError for empty payloads, malformed JSON/MsgPack, or when
the worker-msgpack feature is not enabled and a MsgPack payload is given.