Skip to main content

extract_payload

Function extract_payload 

Source
pub fn extract_payload(
    comment_body: &str,
) -> Result<RecordPayload, PayloadError>
Expand description

Extract the structured lifecycle payload carried inside comment_body.

  • Returns Ok(payload) on a single well-formed hidden carrier or older plan-issue-record-payload fence whose envelope schema matches PAYLOAD_SCHEMA_V2. The older fence support is carrier-level support for current v2 records; it is not a future old-schema reader contract.
  • Returns Err(NoFence) when the comment does not contain either payload carrier.
  • Returns Err(MultipleFences) when multiple payload carriers are present; each comment carries at most one payload.
  • Returns Err(SchemaMismatch) when the payload parses but its schema does not match the v2 wire identity.
  • Returns Err(InvalidJson) when the payload body is not valid JSON or does not deserialize into the envelope.