Ejemplo
hyper 1.12.0: hyper::Version
Muestra verificada para cargo hyper 1.12.0: hyper::Version. El contrato se ejecutó en rust 1 · linux alpine/x64 · docker y pasó.
sha256:dd7667a4e5e096a833a030152b7c1eb8b619255b4df21c12261ea881594e6c33
Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido.
Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas.
MIT-0
Evidencia de ejecución
El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.
- Base de evidencia
- Contrato firmado aprobado
- Recibos de verificación
- 1
- Claves de firma que lo compilaron
- 1
Entorno declarado
linux x64 cargo
Entornos de las ejecuciones de verificación
| Entorno | Contrato | Etapas | Ejecución |
|---|---|---|---|
| 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-11-07 |
Caso
HOW- Objetivo
- verify hyper::Version in pkg:cargo/hyper@1.12.0
- Paquetes
- Símbolos
-
- hyper::Version
- Creado
- 2026-11-07T17:23:43Z
Contrato
- hyper::Version::default() returns Version::HTTP_11 and formats as "HTTP/1.1" via Debug.
- hyper::Version provides constants HTTP_09, HTTP_10, HTTP_11, HTTP_2, and HTTP_3 with Debug strings "HTTP/0.9", "HTTP/1.0", "HTTP/1.1", "HTTP/2.0", and "HTTP/3.0".
- hyper::Version implements Ord in ascending protocol order (HTTP_09 < HTTP_10 < HTTP_11 < HTTP_2 < HTTP_3).
- hyper::Request::builder().version() and Request::version_mut() configure and mutate the request's hyper::Version.
- hyper::Response::builder().version() and Response::version_mut() configure and mutate the response's hyper::Version.
Archivos
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
Código fuente
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "bytes"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]]
name = "http"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
dependencies = [
"bytes",
"itoa",
]
[[package]]
name = "http-body"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"
dependencies = [
"bytes",
"http",
]
[[package]]
name = "hyper"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c"
dependencies = [
"bytes",
"http",
"http-body",
"tokio",
]
[[package]]
name = "itoa"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "pin-project-lite"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "sample-hyper-version"
version = "0.1.0"
dependencies = [
"hyper",
]
[[package]]
name = "tokio"
version = "1.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
dependencies = [
"pin-project-lite",
]
[package]
name = "sample-hyper-version"
version = "0.1.0"
edition = "2021"
publish = false
[dependencies]
hyper = "=1.12.0"
[[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 hyper::Version in pkg:cargo/hyper@1.12.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/hyper@1.12.0
Demonstrate these symbols/APIs:
- hyper::Version
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:f5682d190c1e84c65cc24f34721aacbd6ae3c850b7fe4c7b72d78e2056d181a0","contract":["hyper::Version::default() returns Version::HTTP_11 and formats as \"HTTP/1.1\" via Debug.","hyper::Version provides constants HTTP_09, HTTP_10, HTTP_11, HTTP_2, and HTTP_3 with Debug strings \"HTTP/0.9\", \"HTTP/1.0\", \"HTTP/1.1\", \"HTTP/2.0\", and \"HTTP/3.0\".","hyper::Version implements Ord in ascending protocol order (HTTP_09 \u003c HTTP_10 \u003c HTTP_11 \u003c HTTP_2 \u003c HTTP_3).","hyper::Request::builder().version() and Request::version_mut() configure and mutate the request's hyper::Version.","hyper::Response::builder().version() and Response::version_mut() configure and mutate the response's hyper::Version."],"goal":"verify hyper::Version in pkg:cargo/hyper@1.12.0","kind":"HOW","packages":["pkg:cargo/hyper@1.12.0"],"schemaVersion":1,"symbols":["hyper::Version"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","ecosystem":"cargo","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/hyper@1.12.0"],"schemaVersion":1,"subject":"pkg:cargo/hyper@1.12.0","symbols":["hyper::Version"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify hyper::Version in pkg:cargo/hyper@1.12.0",
"kind": "HOW",
"packages": [
"pkg:cargo/hyper@1.12.0"
],
"symbols": [
"hyper::Version"
]
}
pub use hyper::{Request, Response, Version};
use hyper::{Request, Response, Version};
fn main() {
// 1. Version::default() returns Version::HTTP_11
let default_ver = Version::default();
assert_eq!(default_ver, Version::HTTP_11);
assert_eq!(format!("{:?}", default_ver), "HTTP/1.1");
// 2. All HTTP version constants have distinct values and canonical Debug strings
assert_eq!(format!("{:?}", Version::HTTP_09), "HTTP/0.9");
assert_eq!(format!("{:?}", Version::HTTP_10), "HTTP/1.0");
assert_eq!(format!("{:?}", Version::HTTP_11), "HTTP/1.1");
assert_eq!(format!("{:?}", Version::HTTP_2), "HTTP/2.0");
assert_eq!(format!("{:?}", Version::HTTP_3), "HTTP/3.0");
// 3. Version implements Ord in chronological protocol order
assert!(Version::HTTP_09 < Version::HTTP_10);
assert!(Version::HTTP_10 < Version::HTTP_11);
assert!(Version::HTTP_11 < Version::HTTP_2);
assert!(Version::HTTP_2 < Version::HTTP_3);
// 4. Request::builder().version() and Request::version_mut() set and update hyper::Version
let mut req = Request::builder()
.version(Version::HTTP_2)
.uri("http://example.com/")
.body(())
.expect("valid request");
assert_eq!(req.version(), Version::HTTP_2);
*req.version_mut() = Version::HTTP_11;
assert_eq!(req.version(), Version::HTTP_11);
// 5. Response::builder().version() and Response::version_mut() set and update hyper::Version
let mut res = Response::builder()
.version(Version::HTTP_3)
.status(200)
.body(())
.expect("valid response");
assert_eq!(res.version(), Version::HTTP_3);
*res.version_mut() = Version::HTTP_2;
assert_eq!(res.version(), Version::HTTP_2);
}
Seeder de origen
anónimo