サンプル
once_cell 1.21.4: Handle OnceCell try_insert (&T, T) error tuple return shape, Lazy into_value unevaluated Err(F) return, poison-free panic retry semantics, and &mut cell reset
検証済みサンプル — cargo once_cell 1.21.4: Handle OnceCell try_insert (&T, T) error tuple return shape, Lazy into_value unevaluated Err(F) return, poison-free panic…
sha256:606853390ed4aa0c8d86a36f2445430ec301faa64e65777b8f5770fd50e5ec46
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。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- ゴール
- Handle OnceCell try_insert (&T, T) error tuple return shape, Lazy into_value unevaluated Err(F) return, poison-free panic retry semantics, and &mut cell reset
- パッケージ
- シンボル
-
- once_cell::sync::OnceCell
- once_cell::sync::OnceCell::try_insert
- once_cell::sync::OnceCell::set
- once_cell::sync::OnceCell::get_mut
- once_cell::sync::OnceCell::take
- once_cell::sync::Lazy
- once_cell::sync::Lazy::into_value
- once_cell::sync::Lazy::get
- once_cell::sync::Lazy::force
- 環境
- rust
- 作成日
- 2026-08-16T08:09:37Z
コントラクト
- assert OnceCell::try_insert returns Ok(&T) on success and Err((&T, T)) with the existing reference and rejected value on collision instead of Err(T)
- assert OnceCell::set returns Result<(), T> without handing back a reference to the stored value
- assert Lazy::into_value on an uninitialized Lazy returns Err(F) without calling the initializer closure, and returns Ok(T) only after initialization
- assert Lazy::get returns None prior to forced evaluation without triggering the closure
- assert OnceCell does not become poisoned when get_or_init panics and allows subsequent initializations to retry and succeed
- assert OnceCell with &mut access can be modified in-place via get_mut and reset to empty via take for re-initialization
ファイル
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
- tests/contract.rs