샘플
form_urlencoded 1.2.2
검증된 샘플 — cargo form_urlencoded 1.2.2. rust 1 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: parse parses query string into key-value pairs with URL…
sha256:eee332098ff1241c5d178d5dce290925f69a5d5c546043d27e43d3c5cdf1ab5b
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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 pkg:cargo/form_urlencoded@1.2.2
- 생성일
- 2026-09-18T01:08:51Z
컨트랙트
- parse parses query string into key-value pairs with URL decoding
- parse handles key-only pairs without equal signs
- Serializer serializes key-value pairs into application/x-www-form-urlencoded string
- Serializer handles key-only parameters
- Serializer extend_pairs extends existing query string with multiple pairs
- byte_serialize encodes special characters into percent-encoded strings
파일
- 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 pkg:cargo/form_urlencoded@1.2.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/form_urlencoded@1.2.2
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:e51db34f8db769ad0e5de60c6ba6bb0b21da705d4617dad49123b2bb125c77b7","contract":["parse parses query string into key-value pairs with URL decoding","parse handles key-only pairs without equal signs","Serializer serializes key-value pairs into application/x-www-form-urlencoded string","Serializer handles key-only parameters","Serializer extend_pairs extends existing query string with multiple pairs","byte_serialize encodes special characters into percent-encoded strings"],"goal":"verify pkg:cargo/form_urlencoded@1.2.2","kind":"HOW","packages":["pkg:cargo/form_urlencoded@1.2.2"],"schemaVersion":1},"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","verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify pkg:cargo/form_urlencoded@1.2.2",
"kind": "HOW",
"packages": [
"pkg:cargo/form_urlencoded@1.2.2"
]
}
//! Clean-room verification sample for form_urlencoded.
pub use form_urlencoded::*;
use form_urlencoded::{byte_serialize, parse, Serializer};
use std::borrow::Cow;
fn main() {
// 1. parse parses query string into key-value pairs with URL decoding
let query = b"name=Jane+Doe&greeting=Hello%20World%21&num=42";
let pairs: Vec<(Cow<str>, Cow<str>)> = parse(query).collect();
assert_eq!(pairs.len(), 3);
assert_eq!(pairs[0], (Cow::Borrowed("name"), Cow::Borrowed("Jane Doe")));
assert_eq!(pairs[1], (Cow::Borrowed("greeting"), Cow::Borrowed("Hello World!")));
assert_eq!(pairs[2], (Cow::Borrowed("num"), Cow::Borrowed("42")));
// 2. parse handles key-only pairs without equal signs
let flag_query = b"flag1&flag2=&flag3=value";
let flag_pairs: Vec<(Cow<str>, Cow<str>)> = parse(flag_query).collect();
assert_eq!(flag_pairs.len(), 3);
assert_eq!(flag_pairs[0], (Cow::Borrowed("flag1"), Cow::Borrowed("")));
assert_eq!(flag_pairs[1], (Cow::Borrowed("flag2"), Cow::Borrowed("")));
assert_eq!(flag_pairs[2], (Cow::Borrowed("flag3"), Cow::Borrowed("value")));
// 3. Serializer serializes key-value pairs into application/x-www-form-urlencoded string
let serialized: String = Serializer::new(String::new())
.append_pair("name", "Jane Doe")
.append_pair("greeting", "Hello World!")
.finish();
assert_eq!(serialized, "name=Jane+Doe&greeting=Hello+World%21");
// 4. Serializer handles key-only parameters
let key_only: String = Serializer::new(String::new())
.append_key_only("flag")
.append_pair("k", "v")
.finish();
assert_eq!(key_only, "flag&k=v");
// 5. Serializer extend_pairs extends existing query string with multiple pairs
let extra = vec![("filter", "active"), ("sort", "desc")];
let extended: String = Serializer::new(String::from("page=1"))
.extend_pairs(extra)
.finish();
assert_eq!(extended, "page=1&filter=active&sort=desc");
// 6. byte_serialize encodes special characters into percent-encoded strings
let encoded: String = byte_serialize(b"foo bar / ?").collect();
assert_eq!(encoded, "foo+bar+%2F+%3F");
println!("All form_urlencoded contract assertions passed successfully.");
}
오리진 시더
익명