Parametrized over the document type code so the public root parse<C>(code, input)
can narrow result.code to the exact C the caller passed in (instead of the
whole DocumentTypeCode union). The default C = DocumentTypeCode keeps
unparametrized references (ParseResult with no type argument) backwards
compatible — they behave exactly as they did pre-v1.0.
Discriminated union returned by
parse().Parametrized over the document type code so the public root
parse<C>(code, input)can narrowresult.codeto the exactCthe caller passed in (instead of the wholeDocumentTypeCodeunion). The defaultC = DocumentTypeCodekeeps unparametrized references (ParseResultwith no type argument) backwards compatible — they behave exactly as they did pre-v1.0.No exceptions are thrown from public API.