pub fn parse(
payload: &Bytes,
format: PayloadFormat,
) -> Result<ParsedPayload, CodecError>Available on crate feature
transport only.Expand description
Parse a framed payload into a native ParsedPayload.
PayloadFormat::Json-> sonic_rs (SIMD).PayloadFormat::MsgPack-> rmpv (native, no JSON bridge).PayloadFormat::Auto->PayloadFormat::detectthen dispatch. An empty blob detects as JSON (matchingdetect’s contract) and surfaces aCodecError::Json– empty input is not valid JSON.
§Errors
Returns CodecError::Json or CodecError::MsgPack when the bytes are
malformed for the (detected or declared) format.