CodeSampleX

Exemplo

winnow 1.0.4: Distinguish winnow error handling paths where alt combinator discards deep branch errors in favor of the last branch unless cut_err is used, try_map failures yield recoverable Backtrack rather than fatal Cut, and ContextError formatting displays only the innermost label while InputError drops context annotations entirely

Amostra verificada para cargo winnow 1.0.4: Distinguish winnow error handling paths where alt combinator discards deep branch errors in favor of the last…

sha256:37c7408540f30c3e0ea78c7a69f7ddb967574c1c9fbfebcf11fbf25d3bbe07d5

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
2
Chaves de assinatura que o compilaram
2
Ambiente declarado rust linux x64 rust rust cargo

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
rust 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · cargo@1
2026-08-16
rust 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · cargo@1
2026-08-18

Caso

HOW
Objetivo
Distinguish winnow error handling paths where alt combinator discards deep branch errors in favor of the last branch unless cut_err is used, try_map failures yield recoverable Backtrack rather than fatal Cut, and ContextError formatting displays only the innermost label while InputError drops context annotations entirely
Pacotes
Símbolos
  • winnow::error::ContextError
  • winnow::error::ErrMode
  • winnow::error::InputError
  • winnow::error::TreeError
  • winnow::error::ParseError
  • winnow::combinator::alt
  • winnow::combinator::cut_err
Ambiente
rust
Criado
2026-08-16T12:43:07Z

Contrato

  1. assert alt with ContextError discards a partial match in an earlier branch and returns the error and offset of the last evaluated branch, while cut_err prevents backtrack and preserves the deep failure site
  2. assert try_map produces ErrMode::Backtrack rather than Cut on external validation failure so alt continues trying subsequent branches
  3. assert TreeError preserves all failed branches of an alt in a hierarchical Alt structure rather than overwriting them with the last branch
  4. assert InputError ignores AddContext labels and records the remaining input slice, whereas ContextError formats the innermost StrContext::Label and all Expected tokens but renders empty if unannotated
  5. assert Parser::parse erases the ErrMode modal distinction into ParseError and reports the offset of trailing unconsumed input when the inner parser succeeds partially

Arquivos

  • Cargo.lock
  • Cargo.toml
  • NOTES.md
  • csx.json
  • src/lib.rs

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed