CodeSampleX

サンプル

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

検証済みサンプル — cargo winnow 1.0.4: Distinguish winnow error handling paths where alt combinator discards deep branch errors in favor of the last branch unless…

sha256:37c7408540f30c3e0ea78c7a69f7ddb967574c1c9fbfebcf11fbf25d3bbe07d5

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 rust linux x64 rust rust cargo

検証実行環境

環境 コントラクト ステージ 実行日
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

ケース

HOW
ゴール
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
パッケージ
シンボル
  • winnow::error::ContextError
  • winnow::error::ErrMode
  • winnow::error::InputError
  • winnow::error::TreeError
  • winnow::error::ParseError
  • winnow::combinator::alt
  • winnow::combinator::cut_err
環境
rust
作成日
2026-08-16T12:43:07Z

コントラクト

  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

ファイル

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

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed