repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ies/crypto_box.rs | miden-crypto/src/ies/crypto_box.rs | //! Core cryptographic primitive for Integrated Encryption Scheme (IES).
//!
//! This module defines the generic `CryptoBox` abstraction that combines a key agreement scheme
//! (e.g. K256 ECDH) with an AEAD scheme (e.g. XChaCha20-Poly1305) to provide authenticated
//! encryption.
use alloc::vec::Vec;
use rand::{Cryp... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ies/tests.rs | miden-crypto/src/ies/tests.rs | #![cfg(feature = "std")]
use alloc::vec::Vec;
use proptest::prelude::*;
use rand::{RngCore, SeedableRng};
use rand_chacha::ChaCha20Rng;
use crate::{
dsa::{ecdsa_k256_keccak::SecretKey, eddsa_25519_sha512::SecretKey as SecretKey25519},
ies::{keys::EphemeralPublicKey, *},
utils::{Deserializable, Deserializ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ies/mod.rs | miden-crypto/src/ies/mod.rs | //! Integrated Encryption Scheme (IES) utilities.
//!
//! This module combines elliptic-curve Diffie–Hellman (ECDH) key agreement with authenticated
//! encryption (AEAD) to provide sealed boxes that offer confidentiality and integrity for messages.
//! It exposes a simple API via [`SealingKey`], [`UnsealingKey`], [`Se... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ies/message.rs | miden-crypto/src/ies/message.rs | use alloc::vec::Vec;
use core::convert::TryFrom;
use super::{IesScheme, keys::EphemeralPublicKey};
use crate::utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable};
// SEALED MESSAGE
// ================================================================================================
/// ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ies/keys.rs | miden-crypto/src/ies/keys.rs | use alloc::vec::Vec;
use core::fmt;
use rand::{CryptoRng, RngCore};
use super::{IesError, IesScheme, crypto_box::CryptoBox, message::SealedMessage};
use crate::{
Felt,
aead::{aead_rpo::AeadRpo, xchacha::XChaCha},
ecdh::{KeyAgreementScheme, k256::K256, x25519::X25519},
utils::{ByteReader, ByteWriter, D... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/rand/test_utils.rs | miden-crypto/src/rand/test_utils.rs | //! Test and benchmark utilities for generating random data.
//!
//! This module provides helper functions for tests and benchmarks that need
//! random data generation. These functions replace the functionality previously
//! provided by winter-rand-utils.
use alloc::vec::Vec;
use rand::{Rng, SeedableRng};
use rand_... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/rand/rpo.rs | miden-crypto/src/rand/rpo.rs | use alloc::{string::ToString, vec::Vec};
use p3_field::{ExtensionField, PrimeField64};
use rand_core::impls;
use super::{Felt, FeltRng, RngCore};
use crate::{
Word, ZERO,
hash::rpo::Rpo256,
utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable},
};
// CONSTANTS
// ===========... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/rand/rpx.rs | miden-crypto/src/rand/rpx.rs | use alloc::{string::ToString, vec::Vec};
use p3_field::{ExtensionField, PrimeField64};
use rand_core::impls;
use super::{Felt, FeltRng, RngCore, Word};
use crate::{
ZERO,
hash::rpx::Rpx256,
utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable},
};
// CONSTANTS
// ===========... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/rand/mod.rs | miden-crypto/src/rand/mod.rs | //! Pseudo-random element generation.
use p3_field::PrimeField64;
use rand::RngCore;
use crate::{Felt, Word};
mod rpo;
pub use rpo::RpoRandomCoin;
mod rpx;
pub use rpx::RpxRandomCoin;
// Test utilities for generating random data (used in tests and benchmarks)
#[cfg(any(test, feature = "std"))]
pub mod test_utils;
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/aead/mod.rs | miden-crypto/src/aead/mod.rs | //! AEAD (authenticated encryption with associated data) schemes.
use alloc::{
string::{String, ToString},
vec::Vec,
};
use thiserror::Error;
use crate::{
Felt,
utils::{
Deserializable,
zeroize::{Zeroize, ZeroizeOnDrop},
},
};
pub mod aead_rpo;
pub mod xchacha;
/// Indicates whe... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/aead/xchacha/test.rs | miden-crypto/src/aead/xchacha/test.rs | use proptest::{
prelude::{any, prop},
prop_assert_eq, prop_assert_ne, proptest,
};
use rand::{SeedableRng, TryRngCore};
use rand_chacha::ChaCha20Rng;
use super::*;
// PROPERTY-BASED TESTS
// ================================================================================================
proptest! {
#[tes... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/aead/xchacha/mod.rs | miden-crypto/src/aead/xchacha/mod.rs | //! Cryptographic utilities for encrypting and decrypting data using XChaCha20-Poly1305 AEAD.
//!
//! This module provides secure encryption and decryption functionality. It uses
//! the XChaCha20-Poly1305 authenticated encryption with associated data (AEAD) algorithm,
//! which provides both confidentiality and integr... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/aead/aead_rpo/test.rs | miden-crypto/src/aead/aead_rpo/test.rs | use proptest::{
prelude::{any, prop},
prop_assert_eq, prop_assert_ne, prop_assume, proptest,
};
use rand::{RngCore, SeedableRng};
use rand_chacha::ChaCha20Rng;
use super::*;
// PROPERTY-BASED TESTS
// ================================================================================================
proptest! {... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/aead/aead_rpo/mod.rs | miden-crypto/src/aead/aead_rpo/mod.rs | //! # Arithmetization Oriented AEAD
//!
//! This module implements an AEAD scheme optimized for speed within SNARKs/STARKs.
//! The design is described in \[1\] and is based on the MonkeySpongeWrap construction and uses
//! the RPO (Rescue Prime Optimized) permutation, creating an encryption scheme that is highly
//! e... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/tests/rocksdb_large_smt.rs | miden-crypto/tests/rocksdb_large_smt.rs | use miden_crypto::{
EMPTY_WORD, Felt, ONE, WORD_SIZE, Word, ZERO,
merkle::{
InnerNodeInfo,
smt::{LargeSmt, LargeSmtError, RocksDbConfig, RocksDbStorage},
},
};
use tempfile::TempDir;
fn setup_storage() -> (RocksDbStorage, TempDir) {
let temp_dir = tempfile::Builder::new()
.prefi... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/store.rs | miden-crypto/benches/store.rs | use std::hint::black_box;
use criterion::{BatchSize, BenchmarkId, Criterion, criterion_group, criterion_main};
use miden_crypto::{
Felt, Word,
merkle::{
MerkleTree, NodeIndex,
smt::{LeafIndex, SMT_MAX_DEPTH, SimpleSmt},
store::MerkleStore,
},
rand::test_utils::{rand_array, rand_... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/encryption.rs | miden-crypto/benches/encryption.rs | use std::hint::black_box;
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use miden_crypto::Felt;
mod common;
use common::{
config::{DATA_SIZES, FELT_SIZES},
data::{
generate_byte_array_random, generate_byte_array_sequential, generate_felt_array_random,
ge... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/dsa.rs | miden-crypto/benches/dsa.rs | //! Comprehensive Digital Signature Algorithm (DSA) benchmarks
//!
//! This module benchmarks all DSA operations implemented in the library:
//! - RPO-Falcon512 (Falcon using RPO for hashing)
//! - ECDSA over secp256k1 (using Keccak for hashing)
//! - EdDSA (Ed25519 using SHA-512)
//!
//! # Organization
//!
//! The ben... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/smt.rs | miden-crypto/benches/smt.rs | //! Comprehensive Sparse Merkle Tree (SMT) operation benchmarks
//!
//! This module benchmarks all public APIs of the SMT implementations
//! with a focus on tree creation, updates, proofs, and mutations.
//!
//! # Organization
//!
//! The benchmarks are organized by:
//! 1. Full SMT benchmarks (Smt struct)
//! 2. Simp... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/partial_mt.rs | miden-crypto/benches/partial_mt.rs | //! PartialMerkleTree construction and operation benchmarks.
use std::hint;
use criterion::{BatchSize, Bencher, Criterion, criterion_group, criterion_main};
use miden_crypto::{
Word,
merkle::{NodeIndex, PartialMerkleTree},
};
mod common;
use common::data::{WordPattern, generate_word_pattern};
// === Partial... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/merkle.rs | miden-crypto/benches/merkle.rs | //! MerkleTree construction and operation benchmarks.
//!
//! This module benchmarks the creation and operations of Merkle trees,
//! including tree construction, path computation, updates, and verification.
use std::hint;
use criterion::{BatchSize, Bencher, Criterion, criterion_group, criterion_main};
use miden_cryp... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/rand.rs | miden-crypto/benches/rand.rs | //! Comprehensive random number generation benchmarks
//!
//! This module benchmarks all random number generation operations implemented in the library
//! with a focus on RPO and RPX-based random coins.
//!
//! # Organization
//!
//! The benchmarks are organized by:
//! 1. Random coin initialization using benchmark_ra... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/hash.rs | miden-crypto/benches/hash.rs | //! Simplified hash function benchmarks
//!
//! This module focuses on the two key operations across all hash functions:
//! 1. merge() - 2-to-1 hash merge (single permutation)
//! 2. hash_elements() - Sequential hashing of field elements (especially 100 elements)
//!
//! # Organization
//!
//! The benchmarks are organ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/large-smt.rs | miden-crypto/benches/large-smt.rs | use std::hint;
use criterion::{Criterion, criterion_group, criterion_main};
use miden_crypto::{
Word,
merkle::smt::{LargeSmt, RocksDbConfig, RocksDbStorage},
};
mod common;
use common::*;
use crate::{
common::data::{generate_smt_entries_sequential, generate_test_keys_sequential},
config::{DEFAULT_MEA... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/word.rs | miden-crypto/benches/word.rs | //! Comprehensive Word operation benchmarks
//!
//! This module benchmarks all Word operations implemented in the library
//! with a focus on type conversions, serialization, and lexicographic ordering.
//!
//! # Organization
//!
//! The benchmarks are organized by:
//! 1. Word creation and basic operations
//! 2. Type... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/common/config.rs | miden-crypto/benches/common/config.rs | //! Benchmark configuration constants and settings
//!
//! This module contains all configuration constants used across benchmark modules
//! to ensure consistency and make it easy to adjust benchmark parameters.
use std::time::Duration;
// === Core Configuration ===
/// Default measurement time for most benchmarks
p... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/common/macros.rs | miden-crypto/benches/common/macros.rs | // Benchmark macros to reduce boilerplate code
//
// This module provides procedural macros to eliminate repetitive
// patterns commonly found in benchmark code.
// Creates a unified hash benchmark macro that eliminates duplication
//
// This is the core macro that all other hash macros build upon.
// It supports cust... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/common/mod.rs | miden-crypto/benches/common/mod.rs | //! Common benchmark configuration and utilities for systematic benchmarking.
//!
//! This module provides standardized configuration and helper functions
//! to ensure consistent benchmarking across all benchmark modules.
//!
//! # Organization
//!
//! All benchmark modules follow this structure:
//! 1. Configuration ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/benches/common/data.rs | miden-crypto/benches/common/data.rs | //! Data generation utilities for consistent benchmark inputs
//!
//! This module provides generic functions for generating test data
//! across all benchmark modules to ensure reproducible and consistent results.
//!
//! # Word Patterns
//!
//! The module provides several predefined word patterns for different use cas... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-serde-utils/src/lib.rs | miden-serde-utils/src/lib.rs | // Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
use alloc::{
collections::{BTreeMap, BTreeSet},
format,
strin... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-serde-utils/src/byte_writer.rs | miden-serde-utils/src/byte_writer.rs | // Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
use crate::Serializable;
// BYTE WRITER TRAIT
// ========================================================================================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-serde-utils/src/byte_reader.rs | miden-serde-utils/src/byte_reader.rs | // Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#[cfg(feature = "std")]
use alloc::string::ToString;
use alloc::{format, string::String, vec::Vec};
#[cfg(feature = "std")]
use core::cell... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/mylib.rs | activities/src/mylib.rs | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false | |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a31.rs | activities/src/bin/a31.rs | // Topic: Trait Objects
//
// Summary:
// A contractor wants a program that can sum the cost of materials based
// on how many square meters are required for a job.
//
// Requirements:
// * Calculate multiple material types with different costs
// * Must be able to process a list of varying materials
// * Material ... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-basic-match.rs | activities/src/bin/demo-basic-match.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a42.rs | activities/src/bin/a42.rs | // Topic: Implementing Iterator
//
// Summary:
// A game uses a scoring system that includes a score multiplier.
// The multiplier starts at 1 and increases by 1 each iteration.
// The amount the multiplier increases each iteration can be
// adjusted through in-game powerups.
//
// Example multiplier progression:
// 1,... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a29.rs | activities/src/bin/a29.rs | // Topic: Generics & Functions
//
// Requirements:
// * Create a function that accepts the Priority trait as a generic parameter
// * The function should print out the guest and their priority
// * Use the function with at least two different guests
//
// Notes:
// * Use the debug token "{:?}" to print out the inform... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a23.rs | activities/src/bin/a23.rs | // Topic: Option combinators
//
// Requirements:
// * Use combinators as described in the functions:
// part_1, part_2, and part_3
//
// Notes:
// * Run `cargo test --bin a23` to check your program.
// * Only edit the part_1, part_2, and part_3 functions.
fn part_1() -> bool {
// We are checking whether or not t... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-macro-impl-blocks.rs | activities/src/bin/demo-macro-impl-blocks.rs | #[derive(Clone, Copy)]
struct Volume(usize);
trait ReagentContainer {
fn max_volume(&self) -> Volume;
fn current_volume(&self) -> Volume;
}
struct TallFlask {
current_volume: Volume,
}
struct TestTube {
current_volume: Volume,
}
struct Pipette {
current_volume: Volume,
}
struct OtherTube {
... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-trait-objects.rs | activities/src/bin/demo-trait-objects.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-structs.rs | activities/src/bin/demo-structs.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a41.rs | activities/src/bin/a41.rs | // Topic: Arc, Mutex, and Threads
//
// Summary:
// Modify the existing multi-threaded program to include a global
// counter shared among the threads. The counter should increase
// by 1 whenever a worker completes a job.
//
// Requirements:
// * The total number of jobs completed must be displayed
// at the end of ... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-lifetimes.rs | activities/src/bin/demo-lifetimes.rs | #[derive(Debug)]
struct Cards {
inner: Vec<IdCard>,
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd)]
enum City {
Barland,
Bazopolis,
Fooville,
}
#[derive(Debug)]
struct IdCard {
name: String,
age: u8,
city: City,
}
impl IdCard {
pub fn new(name: &str, age: u8, city: City) -> Self {
... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a26c.rs | activities/src/bin/a26c.rs | // Topic: External Modules
//
// Summary:
// The existing program is complete, but all the code exists
// in a single module. This code can benefit from being organized
// into multiple external modules.
//
// Requirements:
// * Organize the code into two external modules based on their functionality:
// - msg: strin... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-strings.rs | activities/src/bin/demo-strings.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-blanket-impl.rs | activities/src/bin/demo-blanket-impl.rs | trait IdentifyUser {
// return user id to identify them
fn get_user_id(&self) -> u32;
}
struct User {
user_id: u32,
}
impl IdentifyUser for User {
fn get_user_id(&self) -> u32 {
self.user_id
}
}
fn main() {
let user = User { user_id: 42 };
// using the `get_user_id` method from t... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-tuples.rs | activities/src/bin/demo-tuples.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-ranges.rs | activities/src/bin/demo-ranges.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-macro-checked-config.rs | activities/src/bin/demo-macro-checked-config.rs | use std::collections::HashMap;
#[derive(Debug)]
struct ConfigSection<'a> {
name: &'a str,
data: HashMap<&'a str, String>,
}
impl<'a> ConfigSection<'a> {
pub fn insert(&mut self, key: &'a str, value: String) {
self.data.insert(key, value);
}
}
#[derive(Debug)]
struct Configuration<'a> {
se... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/m4.rs | activities/src/bin/m4.rs | // Topic: Basic syntax extension macro
//
// Summary:
// Create a syntax extension macro that allows selecting items out of an iterator
// using human-readable terms.
//
// Requirements:
// * Implement the remaining macro_rules matchers using the formats shown in the main function.
// * The type returned by the mac... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/mc-02.rs | activities/src/bin/mc-02.rs | // Topic: Delegating functionality
//
// Summary:
// The below program is used as part of an inventory management system that tracks the total
// quantity of available items. The business would like a notification to be sent when the
// inventory of an item gets low.
//
// Requirements:
// - Create a proxy struct... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a8.rs | activities/src/bin/a8.rs | // Topic: Organizing similar data using structs
//
// Requirements:
// * Print the flavor of a drink and it's fluid ounces
//
// Notes:
// * Use an enum to create different flavors of drinks
// * Use a struct to store drink flavor and fluid ounce information
// * Use a function to print out the drink flavor and ounces
... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-tdd-maintainable-tests.rs | activities/src/bin/demo-tdd-maintainable-tests.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-expressions.rs | activities/src/bin/demo-expressions.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-ext-trait-1.rs | activities/src/bin/demo-ext-trait-1.rs | fn main() {
let number = 4;
}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-macro-syntax-extensions.rs | activities/src/bin/demo-macro-syntax-extensions.rs | // iterable[start:end-1]
// iterable[1:3] -> items at index 1 and 2
// iterable[k]
// iterable[3] -> retrieve item at index 3
// iterable[start:]
// iterable[3:] -> skip 3, until the end
// iterable[:end-1]
// iterable[:5] -> take everything up to (but not including) index 5
fn main() {}
#[cfg(test)]
mod test {
... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a1.rs | activities/src/bin/a1.rs | // Topic: Functions
//
// Program requirements:
// * Displays your first and last name
//
// Notes:
// * Use a function to display your first name
// * Use a function to display your last name
// * Use the println macro to display messages to the terminal
fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a20.rs | activities/src/bin/a20.rs | // Topic: User input
//
// Requirements:
// * Verify user input against pre-defined keywords
// * The keywords represent possible power options for a computer:
// * Off
// * Sleep
// * Reboot
// * Shutdown
// * Hibernate
// * If the user enters one of the keywords, a message should be printed to
// the cons... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a37.rs | activities/src/bin/a37.rs | // Topic: TryFrom/TryInto
//
// Summary:
// * A library is needed for an application to convert hex color codes
// into their component color values (red, green, and blue). Hex color codes
// consist of a hash symbol followed by six hex digits. Every two hex digits
// represent a color component in the order of r... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/mc-04.rs | activities/src/bin/mc-04.rs | // Topic: Test-driven development (TDD)
//
// Summary:
// You have been tasked to create a system that records and analyzes readings from a temperature
// sensor. Implement the program requirements using TDD.
//
// Requirements:
// - Define a `TemperatureSensor` struct that stores a list of temperature readings (e.... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a12.rs | activities/src/bin/a12.rs | // Topic: Implementing functionality with the impl keyword
//
// Requirements:
// * Print the characteristics of a shipping box
// * Must include dimensions, weight, and color
//
// Notes:
// * Use a struct to encapsulate the box characteristics
// * Use an enum for the box color
// * Implement functionality on the box... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a18.rs | activities/src/bin/a18.rs | // Topic: Result
//
// Requirements:
// * Create an structure named `Adult` that represents a person aged 21 or older:
// * The structure must contain the person's name and age
// * Implement Debug print functionality using `derive`
// * Implement a `new` function for the `Adult` structure that returns a Result:
//... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a26b.rs | activities/src/bin/a26b.rs | // Topic: Inline Modules
//
// Summary:
// The existing program is complete, but all the code exists
// in a single module. This code can benefit from being organized
// into multiple modules.
//
// Requirements:
// * Organize the code into two modules based on their functionality:
// - msg: string formatting functio... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a13.rs | activities/src/bin/a13.rs | // Topic: Vectors
//
// Requirements:
// * Print 10, 20, "thirty", and 40 in a loop
// * Print the total number of elements in a vector
//
// Notes:
// * Use a vector to store 4 numbers
// * Iterate through the vector using a for..in loop
// * Determine whether to print the number or print "thirty" inside the loop
// *... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-testing.rs | activities/src/bin/demo-testing.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a32.rs | activities/src/bin/a32.rs | // Topic: Lifetimes & Structures
//
// Requirements:
// * Display just the names and titles of persons from the mock-data.csv file
// * The names & titles must be stored in a struct separately from the mock
// data for potential later usage
// * None of the mock data may be duplicated in memory
//
// Notes:
// * The ... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/mc-03.rs | activities/src/bin/mc-03.rs | // Topic: Extension traits
//
// Summary:
// The following program simulates an account management system where users can deposit and
// withdraw money. The goal is to extend basic account operations with additional features using
// an extension trait.
//
// Requirements:
// - Create an extension trait named `Ac... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/m3.rs | activities/src/bin/m3.rs | // Topic: Basic macro repetitions
//
// Requirements:
// * Create a macro to generate hashmaps.
// * The macro must be able to accept multiple key/value pairs.
// * Print out the generated hashmap using the `dbg!` macro to ensure it works.
fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-option-combinator-pattern.rs | activities/src/bin/demo-option-combinator-pattern.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-tdd-struct.rs | activities/src/bin/demo-tdd-struct.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a27.rs | activities/src/bin/a27.rs | // Topic: Custom error types
//
// Requirements:
// * Modify the `ProgramError` enum in order to make the program compile
// and run. Do not modify any other part of the program.
// * The output should display a menu error followed by a math error when running.
//
// Notes:
// * Use `#[error("description")]` on the e... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-tdd-fn.rs | activities/src/bin/demo-tdd-fn.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a4a.rs | activities/src/bin/a4a.rs | // Topic: Decision making with match
//
// Program requirements:
// * Display "it's true" or "it's false" based on the value of a variable
//
// Notes:
// * Use a variable set to either true or false
// * Use a match expression to determine which message to display
fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a15.rs | activities/src/bin/a15.rs | // Topic: Advanced match
//
// Requirements:
// * Print out a list of tickets and their information for an event
// * Tickets can be Backstage, Vip, and Standard
// * Backstage and Vip tickets include the ticket holder's name
// * All tickets include the price
//
// Notes:
// * Use an enum for the tickets with data ass... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-result.rs | activities/src/bin/demo-result.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-control-flow-if-else.rs | activities/src/bin/demo-control-flow-if-else.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-proxy-delegate.rs | activities/src/bin/demo-proxy-delegate.rs | pub trait Printer {
fn print(&self, msg: String);
}
fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-arc-mutex.rs | activities/src/bin/demo-arc-mutex.rs | use parking_lot::Mutex;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
type SharedSignData = Arc<Mutex<String>>;
struct DigitalSignBoard {
display: SharedSignData,
}
fn spawn_display_thread(display_data: SharedSignData) {
thread::spawn(|| {});
}
fn change_data(display_data: SharedSignData, ne... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a19.rs | activities/src/bin/a19.rs | // Topic: HashMap
//
// Requirements:
// * Print the name and number of items in stock for a furniture store
// * If the number of items is 0, print "out of stock" instead of 0
// * The store has:
// * 5 Chairs
// * 3 Beds
// * 2 Tables
// * 0 Couches
// * Print the total number of items in stock
//
// Notes:
/... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-vector-basics.rs | activities/src/bin/demo-vector-basics.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a14.rs | activities/src/bin/a14.rs | // Topic: Strings
//
// Requirements:
// * Print out the name and favorite colors of people aged 10 and under
//
// Notes:
// * Use a struct for a persons age, name, and favorite color
// * The color and name should be stored as a String
// * Create and store at least 3 people in a vector
// * Iterate through the vecto... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a11.rs | activities/src/bin/a11.rs | // Topic: Ownership
//
// Requirements:
// * Print out the quantity and id number of a grocery item
//
// Notes:
// * Use a struct for the grocery item
// * Use two i32 fields for the quantity and id number
// * Create a function to display the quantity, with the struct as a parameter
// * Create a function to display ... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/p1.rs | activities/src/bin/p1.rs | // Project 1: Interactive bill manager
//
// Summary:
// Create a command line bills/expenses manager that runs
// interactively. This mini project brings together many of
// the concepts learn thus far into a single application.
//
// The user stories/requirements are split into stages.
// Fully implement ea... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-loop-expression.rs | activities/src/bin/demo-loop-expression.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a35.rs | activities/src/bin/a35.rs | // Topic: Match guards & binding
//
// Summary:
// * A tile-based game requires different logic for different kinds
// of tiles. Print different messages depending on the kind of
// tile selected.
//
// Requirements:
// * Bricks:
// * Colored bricks should print "The brick color is [color]"
// * Other bricks sh... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-if-let-else.rs | activities/src/bin/demo-if-let-else.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-custom-error-types.rs | activities/src/bin/demo-custom-error-types.rs | use chrono::{DateTime, Duration, Utc};
use thiserror::Error;
struct SubwayPass {
id: usize,
funds: isize,
expires: DateTime<Utc>,
}
fn swipe_card() -> Result<SubwayPass, PassError> {
// Err(PassError::ReadError("magstrip failure".to_owned()))
Ok(SubwayPass {
id: 0,
funds: 200,
... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-implementing-default.rs | activities/src/bin/demo-implementing-default.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a22.rs | activities/src/bin/a22.rs | // Topic: Testing
//
// Requirements:
// * Write tests for the existing program to ensure proper functionality.
//
// Notes:
// * Create at least two test cases for each function.
// * Use `cargo test` to test the program.
// * There are intentional bugs in the program that need to be fixed.
// * Check the documentat... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-traits.rs | activities/src/bin/demo-traits.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a33.rs | activities/src/bin/a33.rs | // Topic: Lifetimes & Functions
//
// Summary:
// Create a program that compares which string is longer (highest length).
//
// Requirements:
// * The comparison must be done using a function named `longest`
// * No data may be copied (cannot use .to_owned() or .to_string())
// * If both strings are the same length, th... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-advanced-match.rs | activities/src/bin/demo-advanced-match.rs | enum Discount {
Percent(i32),
Flat(i32),
}
struct Ticket {
event: String,
price: i32,
}
fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/m2.rs | activities/src/bin/m2.rs | // Topic: Writing implementations with macros
//
// Summary:
// There are multiple id types for this program. Implement the `Deref` trait
// for all id structures.
//
// Requirements:
// * Create a macro which can generate an implementation block.
// * Use the macro to implement Deref for:
// * ContractorId... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a9.rs | activities/src/bin/a9.rs | // Topic: Data management using tuples
//
// Requirements:
// * Print whether the y-value of a cartesian coordinate is
// greater than 5, less than 5, or equal to 5
//
// Notes:
// * Use a function that returns a tuple
// * Destructure the return value into two variables
// * Use an if..else if..else block to determi... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-macro-repetitions.rs | activities/src/bin/demo-macro-repetitions.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-macro-recursive.rs | activities/src/bin/demo-macro-recursive.rs | macro_rules! html {
}
#[allow(unused_must_use)]
fn main() {
use std::fmt::Write;
let mut data = String::new();
html!(&mut data,
html[
head[ title["Demo title"] ]
body[
h1["Sample"]
p["This is a macro demo"]
]
]);
dbg!(data);
}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-while-loop.rs | activities/src/bin/demo-while-loop.rs | fn main() {}
| rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/a40.rs | activities/src/bin/a40.rs | // Topic: Smart Pointers & RefCell
//
// Summary:
// A vehicle rental company wants to access the rentals available
// at storefront locations. Create a program that provides access
// to storefront rentals from the corporate headquarters.
//
// Requirements:
// * Corporate must be able to access the rentals at a... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/demo-typestate-pattern.rs | activities/src/bin/demo-typestate-pattern.rs | struct Employee<State> {
name: String,
state: State,
}
struct Agreement;
struct Signature;
struct Training;
struct FailedTraining {
score: u8,
}
struct OnboardingComplete {
score: u8,
}
impl Employee<Agreement> {
fn new(name: &str) -> Self {
Self {
name: name.to_string(),
... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
jayson-lennon/ztm-rust | https://github.com/jayson-lennon/ztm-rust/blob/cb0ac4768346c7270ba3655b32bef022b4803460/activities/src/bin/m1.rs | activities/src/bin/m1.rs | // Topic: Control flow with macros
//
// Summary:
// The existing program has multiple checks to confirm that a user can access
// a resource. Refactor the `get_data` function to use a macro to check for
// all of the requirements.
//
// Requirements:
// * Create a macro that returns early from a function.
//
// ... | rust | MIT | cb0ac4768346c7270ba3655b32bef022b4803460 | 2026-01-04T20:24:50.396322Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.