pub fn parse_payload(
payload: &[u8],
format: PayloadFormat,
) -> Result<Value, ParseError>Available on (crate features
worker-pool or worker-batch or worker) and crate feature worker-batch 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 | rmp_serde → JSON bridge → sonic_rs (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.