サンプル
wasm-bindgen-macro-support 0.2.128: expand_struct_marker
検証済みサンプル — cargo wasm-bindgen-macro-support 0.2.128: expand_struct_marker. rust 1 · linux alpine/x64 · docker で contract を実行し、成功しました.
sha256:ee4abbb28b20d4c0ebdb1859a8ca182cb2e5258beccad04ebbb0167660c1f1ba
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux x64 cargo
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-10-17 |
ケース
HOW- ゴール
- verify expand_struct_marker in pkg:cargo/wasm-bindgen-macro-support@0.2.128
- シンボル
-
- expand_struct_marker
- 作成日
- 2026-10-17T11:54:37Z
コントラクト
- expand_struct_marker("#[wasm_bindgen(inspectable)] pub struct Point { pub x: i32, #[wasm_bindgen(readonly)] pub id: u32 }") generates WasmDescribe, IntoWasmAbi, FromWasmAbi, __wbg_get_point_x, __wbg_set_point_x, and __wbg_get_point_id without __wbg_set_point_id
- expand_struct_marker("pub fn not_a_struct() {}") returns Err(Diagnostic)
ファイル
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/main.rs
- test/contract.rs
ソース
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "bumpalo"
version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "sample-expand-struct-marker"
version = "0.1.0"
dependencies = [
"wasm-bindgen-macro-support",
]
[[package]]
name = "syn"
version = "3.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e"
dependencies = [
"unicode-ident",
]
[package]
name = "sample-expand-struct-marker"
version = "0.1.0"
edition = "2021"
[dependencies]
wasm-bindgen-macro-support = "=0.2.128"
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify expand_struct_marker in pkg:cargo/wasm-bindgen-macro-support@0.2.128
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/wasm-bindgen-macro-support@0.2.128
Demonstrate these symbols/APIs:
- expand_struct_marker
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:4c0328e1622384a276971a6c35e4d30d006ba91f9e69f8ddc6e012fa61dffa4c","contract":["expand_struct_marker(\"#[wasm_bindgen(inspectable)] pub struct Point { pub x: i32, #[wasm_bindgen(readonly)] pub id: u32 }\") generates WasmDescribe, IntoWasmAbi, FromWasmAbi, __wbg_get_point_x, __wbg_set_point_x, and __wbg_get_point_id without __wbg_set_point_id","expand_struct_marker(\"pub fn not_a_struct() {}\") returns Err(Diagnostic)"],"goal":"verify expand_struct_marker in pkg:cargo/wasm-bindgen-macro-support@0.2.128","kind":"HOW","packages":["pkg:cargo/wasm-bindgen-macro-support@0.2.128"],"schemaVersion":1,"symbols":["expand_struct_marker"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","ecosystem":"cargo","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/wasm-bindgen-macro-support@0.2.128"],"schemaVersion":1,"subject":"pkg:cargo/wasm-bindgen-macro-support@0.2.128","symbols":["expand_struct_marker"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify expand_struct_marker in pkg:cargo/wasm-bindgen-macro-support@0.2.128",
"kind": "HOW",
"packages": [
"pkg:cargo/wasm-bindgen-macro-support@0.2.128"
],
"symbols": [
"expand_struct_marker"
]
}
#[path = "../test/contract.rs"]
mod contract;
fn main() {
contract::verify();
}
use wasm_bindgen_macro_support::expand_struct_marker;
pub fn verify() {
// 1. Public fields generate WasmDescribe, IntoWasmAbi, FromWasmAbi, and both getter and setter glue.
let inspectable_out = expand_struct_marker(
"#[wasm_bindgen(inspectable)] pub struct Point { pub x: i32, #[wasm_bindgen(readonly)] pub id: u32 }"
.parse()
.unwrap(),
)
.expect("expand_struct_marker on valid struct should return Ok")
.to_string();
assert!(
inspectable_out.contains("WasmDescribe")
&& inspectable_out.contains("IntoWasmAbi")
&& inspectable_out.contains("FromWasmAbi"),
"expected ABI trait implementations in expansion: {inspectable_out}"
);
assert!(
inspectable_out.contains("__wbg_get_point_x")
&& inspectable_out.contains("__wbg_set_point_x"),
"expected both getter and setter for mutable public field x: {inspectable_out}"
);
assert!(
inspectable_out.contains("__wbg_get_point_id")
&& !inspectable_out.contains("__wbg_set_point_id"),
"expected getter only (no setter) for readonly public field id: {inspectable_out}"
);
// 2. Non-struct items passed to expand_struct_marker return Err(Diagnostic).
let err = expand_struct_marker("pub fn not_a_struct() {}".parse().unwrap())
.expect_err("expand_struct_marker on a function item must return Err");
let err_dbg = format!("{err:?}");
assert!(
!err_dbg.is_empty(),
"expected non-empty Diagnostic debug output on invalid item"
);
}
オリジンシーダー
匿名