샘플
form_urlencoded 1.2.2: form_urlencoded::Serializer
검증된 샘플 — cargo form_urlencoded 1.2.2: form_urlencoded::Serializer. rust 1 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: Serializer::new creates a…
sha256:85717ebf5f6d46149cebde1ca92459c0dbcb2910a2430c622a7249e0185c9ecb
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux · alpine · musl 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-09-19 |
케이스
HOW- 목표
- verify form_urlencoded::Serializer in pkg:cargo/form_urlencoded@1.2.2
- 심벌
-
- form_urlencoded::Serializer
- 생성일
- 2026-09-18T04:55:59Z
컨트랙트
- Serializer::new creates a Serializer appending to an empty String
- Serializer::append_pair encodes key-value pairs separated by &
- Serializer encodes spaces as + and special characters as percent-encoded bytes
- Serializer::append_key_only appends key without equal sign
- Serializer::extend_pairs appends multiple pairs from an iterator
- Serializer::for_suffix retains target prefix before start_position
파일
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
소스
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "form_urlencoded"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
dependencies = [
"percent-encoding",
]
[[package]]
name = "percent-encoding"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "sample-form-urlencoded"
version = "1.0.0"
dependencies = [
"form_urlencoded",
]
[package]
name = "sample-form-urlencoded"
version = "1.0.0"
edition = "2021"
publish = false
[dependencies]
form_urlencoded = "=1.2.2"
[[bin]]
name = "contract"
path = "test/contract.rs"
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 form_urlencoded::Serializer in pkg:cargo/form_urlencoded@1.2.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/form_urlencoded@1.2.2
Demonstrate these symbols/APIs:
- form_urlencoded::Serializer
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:15a66c834a0e137442fa344600fbb300bf1232d535322cfeb5812c6715608586","contract":["Serializer::new creates a Serializer appending to an empty String","Serializer::append_pair encodes key-value pairs separated by \u0026","Serializer encodes spaces as + and special characters as percent-encoded bytes","Serializer::append_key_only appends key without equal sign","Serializer::extend_pairs appends multiple pairs from an iterator","Serializer::for_suffix retains target prefix before start_position"],"goal":"verify form_urlencoded::Serializer in pkg:cargo/form_urlencoded@1.2.2","kind":"HOW","packages":["pkg:cargo/form_urlencoded@1.2.2"],"schemaVersion":1,"symbols":["form_urlencoded::Serializer"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","distro":"alpine","ecosystem":"cargo","libc":"musl","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/form_urlencoded@1.2.2"],"schemaVersion":1,"subject":"pkg:cargo/form_urlencoded@1.2.2","symbols":["form_urlencoded::Serializer"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify form_urlencoded::Serializer in pkg:cargo/form_urlencoded@1.2.2",
"kind": "HOW",
"packages": [
"pkg:cargo/form_urlencoded@1.2.2"
],
"symbols": [
"form_urlencoded::Serializer"
]
}
//! Clean-room verification sample for form_urlencoded.
pub use form_urlencoded::*;
use form_urlencoded::Serializer;
fn main() {
// 1. Serializer::new creates a Serializer appending to an empty String
let mut s1 = Serializer::new(String::new());
s1.append_pair("name", "alice");
assert_eq!(s1.finish(), "name=alice");
// 2. Serializer::append_pair encodes multiple key-value pairs separated by &
let mut s2 = Serializer::new(String::new());
s2.append_pair("key1", "val1");
s2.append_pair("key2", "val2");
assert_eq!(s2.finish(), "key1=val1&key2=val2");
// 3. Serializer encodes spaces as + and special characters as percent-encoded bytes
let mut s3 = Serializer::new(String::new());
s3.append_pair("query", "hello world & more=yes");
assert_eq!(s3.finish(), "query=hello+world+%26+more%3Dyes");
// 4. Serializer::append_key_only appends key without equal sign
let mut s4 = Serializer::new(String::new());
s4.append_key_only("flag");
s4.append_pair("count", "10");
assert_eq!(s4.finish(), "flag&count=10");
// 5. Serializer::extend_pairs appends multiple pairs from an iterator
let mut s5 = Serializer::new(String::new());
s5.extend_pairs([("a", "1"), ("b", "2"), ("c", "3")].iter().copied());
assert_eq!(s5.finish(), "a=1&b=2&c=3");
// 6. Serializer::for_suffix retains target prefix before start_position
let mut s6 = Serializer::for_suffix("https://example.com/search?".to_string(), 27);
s6.append_pair("q", "rust");
assert_eq!(s6.finish(), "https://example.com/search?q=rust");
println!("All form_urlencoded::Serializer contract assertions passed successfully.");
}
오리진 시더
익명