Skip to main content

parse_payload

Function parse_payload 

Source
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

FormatEngine
Jsonsonic_rs::from_slice (SIMD)
Autobyte-sniff → Json or MsgPack
MsgPackrmp_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.