Skip to main content

decode

Function decode 

Source
pub fn decode(s: &str) -> Result<(Tag, Payload)>
Expand description

Decode an ms1 string into (Tag, Payload).

Rejects per SPEC §4 rules 1-10 (extended for v0.2 mnem):

  • Rule 1: upstream codex32 parse failure (Codex32 variant).
  • Rules 2-4, 8: wire-invariant violations (delegated to envelope::discriminate).
  • Rules 5-7: tag-table membership rules (here).
  • Rule 9: total string length not in the union {entr lengths} ∪ {mnem lengths} (here, before parse); then bound to the discriminated kind post-dispatch.
  • Rule 10: payload byte length mismatch for the tag (here, via Payload::validate()).