Exemple
Use rand 0.10.2 indexed slice sampling with typed weighted errors, bounded sampling, and byte-valued Alphanumeric output
sha256:c6fa4a5c7446994767c9734cd6d5e96121ac9bdeae371e5fb7ffa95f0a42ac83
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Use rand 0.10.2 indexed slice sampling with typed weighted errors, bounded sampling, and byte-valued Alphanumeric output HOW
- Paquets
- rand 0.10.2
- Environnement
- rust
- Créé
- 2026-08-17T01:03:53Z
Contrat
- assert IndexedRandom::choose returns Option while choose_weighted returns Result<&T, WeightError>
- assert an empty slice returns None from choose and Err(InvalidInput) from choose_weighted
- assert all-zero weights return Err(InsufficientNonZero) while negative and NaN weights return Err(InvalidWeight)
- assert IndexedRandom::sample returns distinct references, caps an oversized request at the slice length, and sample_array returns None when the array is too large
- assert IndexedMutRandom::choose_weighted_mut returns a mutable selected item and SliceRandom::shuffle preserves the input elements
- assert Alphanumeric::sample has item type u8, char conversion builds a String, and SampleString builds the requested-length String directly
Fichiers
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9