Beispiel
wasm-bindgen-macro-support 0.2.128: expand_class_marker
Verifiziertes Beispiel für cargo wasm-bindgen-macro-support 0.2.128: expand_class_marker. Der Vertrag lief auf rust 1 · linux alpine/x64 · docker und bestand.
sha256:2961ac4da8db92349491a41372a864a68a9421b7e78c78229fa454fce6d326e0
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
linux x64 rust cargo
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| 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 |
Fall
HOW- Ziel
- verify expand_class_marker in pkg:cargo/wasm-bindgen-macro-support@0.2.128
- Symbole
-
- expand_class_marker
- Erstellt
- 2026-10-17T11:44:53Z
Contract
- expand_class_marker("Accumulator = \"Accumulator\"", "pub fn add_amount(&mut self, step: u32) -> u32 { self.total += step; self.total }") returns Ok(TokenStream) preserving pub fn add_amount and injecting __wasm_bindgen_generated_Accumulator_add_amount
- expand_class_marker("Accumulator = \"JsAccumulator\"", "#[wasm_bindgen(constructor)] pub fn new(initial: u32) -> Accumulator { Accumulator { total: initial } }") returns Ok(TokenStream) preserving pub fn new and injecting __wasm_bindgen_generated_JsAccumulator_new
- expand_class_marker("Accumulator = \"Accumulator\", unknown_key = 1", "pub fn reset(&mut self) {}") returns Err(Diagnostic) for an unknown class marker attribute option
Dateien
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/main.rs
Quelltext
# 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-class-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-class-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_class_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_class_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:6653d9807a9c3999cb2b362ec8550d08f26890dd1cfd648440faf83c508c2a2c","contract":["expand_class_marker(\"Accumulator = \\\"Accumulator\\\"\", \"pub fn add_amount(\u0026mut self, step: u32) -\u003e u32 { self.total += step; self.total }\") returns Ok(TokenStream) preserving pub fn add_amount and injecting __wasm_bindgen_generated_Accumulator_add_amount","expand_class_marker(\"Accumulator = \\\"JsAccumulator\\\"\", \"#[wasm_bindgen(constructor)] pub fn new(initial: u32) -\u003e Accumulator { Accumulator { total: initial } }\") returns Ok(TokenStream) preserving pub fn new and injecting __wasm_bindgen_generated_JsAccumulator_new","expand_class_marker(\"Accumulator = \\\"Accumulator\\\", unknown_key = 1\", \"pub fn reset(\u0026mut self) {}\") returns Err(Diagnostic) for an unknown class marker attribute option"],"goal":"verify expand_class_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_class_marker"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","ecosystem":"cargo","language":"rust","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_class_marker"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify expand_class_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_class_marker"
]
}
use wasm_bindgen_macro_support::expand_class_marker;
fn main() {
let attr = "Accumulator = \"Accumulator\"".parse().unwrap();
let item = "pub fn add_amount(&mut self, step: u32) -> u32 { self.total += step; self.total }"
.parse()
.unwrap();
let expanded = expand_class_marker(attr, item)
.expect("expand_class_marker should succeed on valid method")
.to_string();
assert!(
expanded.contains("pub fn add_amount"),
"expanded output must preserve method signature: {expanded}"
);
assert!(
expanded.contains("__wasm_bindgen_generated_Accumulator_add_amount"),
"expanded output must inject class method wrapper call: {expanded}"
);
let ctor_attr = "Accumulator = \"JsAccumulator\"".parse().unwrap();
let ctor_item = "#[wasm_bindgen(constructor)] pub fn new(initial: u32) -> Accumulator { Accumulator { total: initial } }"
.parse()
.unwrap();
let ctor_expanded = expand_class_marker(ctor_attr, ctor_item)
.expect("expand_class_marker should succeed on constructor")
.to_string();
assert!(
ctor_expanded.contains("pub fn new"),
"constructor expansion must preserve fn new: {ctor_expanded}"
);
assert!(
ctor_expanded.contains("__wasm_bindgen_generated_JsAccumulator_new"),
"constructor expansion must inject generated constructor symbol using JS class name: {ctor_expanded}"
);
let invalid_attr = "Accumulator = \"Accumulator\", unknown_key = 1".parse().unwrap();
let valid_item = "pub fn reset(&mut self) {}".parse().unwrap();
assert!(
expand_class_marker(invalid_attr, valid_item).is_err(),
"expand_class_marker must return Err on unknown attribute option"
);
}
Ursprungs-Seeder
anonym