diff --git a/submissions/week-2/day-3/Stephen-Ngozi-User-Input/.gitignore b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/.gitignore @@ -0,0 +1 @@ +/target diff --git a/submissions/week-2/day-3/Stephen-Ngozi-User-Input/Cargo.lock b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/Cargo.lock new file mode 100644 index 0000000..483ae47 --- /dev/null +++ b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Stephen-Ngozi-User-Input" +version = "0.1.0" diff --git a/submissions/week-2/day-3/Stephen-Ngozi-User-Input/Cargo.toml b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/Cargo.toml new file mode 100644 index 0000000..e17216a --- /dev/null +++ b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "Stephen-Ngozi-User-Input" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/submissions/week-2/day-3/Stephen-Ngozi-User-Input/src/main.rs b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/src/main.rs new file mode 100644 index 0000000..8870704 --- /dev/null +++ b/submissions/week-2/day-3/Stephen-Ngozi-User-Input/src/main.rs @@ -0,0 +1,50 @@ + +use std::io; +enum PowerStatus { + Off, + Sleep, + Reboot, + Shutdown, + Hibernate, +} + +fn format_power_status(input: &str) -> Option { + match input.to_lowercase().as_str() { + "off" => Some(PowerStatus::Off), + "sleep" => Some(PowerStatus::Sleep), + "reboot" => Some(PowerStatus::Reboot), + "shutdown" => Some(PowerStatus::Shutdown), + "hibernate" => Some(PowerStatus::Hibernate), + _ => None, + } +} + + +fn handle_power_status(status: PowerStatus) { + match status { + PowerStatus::Off => println!("Turning off the computer"), + PowerStatus::Sleep => println!("Putting the computer to sleep"), + PowerStatus::Reboot => println!("Rebooting the computer"), + PowerStatus::Shutdown => println!("Shutting down the computer"), + PowerStatus::Hibernate => println!("Hibernating the computer"), + } +} + + + +fn main() { + println!("Enter power option (off, sleep, reboot, shutdown, hibernate):"); + + let mut input = String::new(); + io::stdin() + .read_line(&mut input) + .expect("Failed to read input"); + + let input = input.trim(); + + match format_power_status(input) { + Some(status) => handle_power_status(status), + None => println!("Error: Invalid power option"), + } +} + \ No newline at end of file diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/.gitignore b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/.gitignore new file mode 100644 index 0000000..c41cc9e --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/.gitignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/Cargo.lock b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/Cargo.lock new file mode 100644 index 0000000..ae2415d --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Stephen-Ngozi-Merkle-Tree" +version = "0.1.0" diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/Cargo.toml b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/Cargo.toml new file mode 100644 index 0000000..0587fb5 --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "Stephen-Ngozi-Merkle-Tree" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/expense.rs b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/expense.rs new file mode 100644 index 0000000..986fe5d --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/expense.rs @@ -0,0 +1,17 @@ + + +#[derive(Debug, Clone)] +pub enum TransactionType { + Credit, + Debit, +} + + + +#[derive(Debug, Clone)] +pub struct Expense { + pub id: u8, + pub name: String, + pub amount: f64, + pub tx_type: TransactionType, +} \ No newline at end of file diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/main.rs b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/main.rs new file mode 100644 index 0000000..eec5b9f --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/main.rs @@ -0,0 +1,141 @@ +mod expense; +mod tracker; + +use std::io; +use expense::TransactionType; +use tracker::ExpenseTracker; + + + + +fn print_menu() { + println!("\n=== Expense Tracker ==="); + println!("1 - Add Expense"); + println!("2 - View Expenses"); + println!("3 - Update Expense"); + println!("4 - Delete Expense"); + println!("q - Quit"); +} +fn main() { + // println!("Hello, world!"); + + let mut tracker = ExpenseTracker::new(); + + loop { + print_menu(); + + let mut input = String::new(); + io::stdin().read_line(&mut input).expect("Failed"); + let input = input.trim(); + + + if input == "q" { + println!("Are you sure you want to quit? (y/n)"); + let mut confirm = String::new(); + io::stdin().read_line(&mut confirm).expect("Failed "); + let confirm = confirm.trim(); + + if confirm == "y" { + tracker.save_to_file("stephen_expences.txt"); + println!("Data saved to stephen_expences.txt"); + println!("Bye bye go home!"); + break; + } + }else if input == "1" { + println!("Enter expense name:"); + let mut name = String::new(); + io::stdin().read_line(&mut name).expect("Failed to read input"); + let name = name.trim().to_string(); + + println!("Enter amount:"); + let mut amount_input = String::new(); + io::stdin().read_line(&mut amount_input).expect("Failed to read input"); + let amount: f64 = amount_input.trim().parse().expect("Please enter a valid number"); + + println!("Is this Credit or Debit? (c/d):"); + let mut tx_input = String::new(); + io::stdin().read_line(&mut tx_input).expect("Failed to read input"); + let tx_input = tx_input.trim(); + + let tx_type = if tx_input == "c" { + TransactionType::Credit + } else { + TransactionType::Debit + }; + + let new_expense = tracker.add(name, amount, tx_type); + println!(" Expense added successfully!"); + println!("ID: {}, Name: {}, Amount: ${:.2}, Type: {:?}", + new_expense.id, new_expense.name, new_expense.amount, new_expense.tx_type); + }else if input == "2" { + let expenses = tracker.view_all(); + + if expenses.is_empty() { + println!("No Expenses in the Tracker"); + } else { + println!("All Expenses"); + for expense in expenses { + println!("ID: {} | Name: {} | Amount: Naria{:.2} | Type: {:?}", + expense.id, expense.name, expense.amount, expense.tx_type); + } + } + } else if input == "3" { + println!("Enter the ID of the Expence"); + + let mut new_id_input = String::new(); + + io::stdin().read_line(&mut new_id_input).expect("Failed to read input"); + let id: u8 = new_id_input.trim().parse().expect("Please enter a valid ID"); + + + + println!("Enter new amount:"); + let mut amount_input = String::new(); + io::stdin().read_line(&mut amount_input).expect("Failed to read input"); + let amount: f64 = amount_input.trim().parse().expect("Please enter a valid number"); + + println!("Is this Credit or Debit? (c/d):"); + let mut tx_input = String::new(); + io::stdin().read_line(&mut tx_input).expect("Failed to read input"); + let tx_input = tx_input.trim(); + + let tx_type = if tx_input == "c" { + TransactionType::Credit + } else { + TransactionType::Debit + }; + + if tracker.update(id, amount, tx_type){ + println!("Expense Updated Successfu"); + + if let Some(expense) = tracker.values.get(&id) { + println!("ID: {}, Name: {}, Amount: Naria{:.2}, Type: {:?}", + expense.id, expense.name, expense.amount, expense.tx_type); + }else { + println!("Expense with ID {} not found!", id); + + } + } + }else if input == "4" { + println!("Enter the ID of the expense you to delete:"); + + let mut id_input = String::new(); + + io::stdin().read_line(&mut id_input).expect("Failed to read input"); + let id: u8 = id_input.trim().parse().expect("Please enter a valid ID"); + + if tracker.delete(id){ + println!(" Your Expence is Deleted "); + }else { + println!("Expense with ID {} not found!", id); + } + }else { + println!("Invalid choice. Please try again."); + } + + + + + } + +} diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/tracker.rs b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/tracker.rs new file mode 100644 index 0000000..d454c42 --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/src/tracker.rs @@ -0,0 +1,84 @@ +use std::{collections::HashMap,fs::File,io::Write}; +use crate::expense::{Expense, TransactionType}; + + +// Expense tracker +// Add the expenses +// Remove +// Update +// View + +// Hashmaps +// structs +// enums +// Hashmaps + + + + +pub struct ExpenseTracker { + pub values: HashMap, + pub next_id: u8, +} + +impl ExpenseTracker { + pub fn new() -> Self { + Self { + values: HashMap::new(), + next_id: 1, + } + } + + pub fn add(&mut self, name: String, amount: f64, tx_type: TransactionType) -> Expense { + let current_id = self.next_id; + let new_expense = Expense { + id: current_id, + name, + amount, + tx_type, + }; + self.values.insert(current_id, new_expense.clone()); + self.next_id += 1; + new_expense + } + + pub fn view_all(&self) -> Vec<&Expense> { + let mut expenses: Vec<&Expense> = self.values.values().collect(); + + expenses.sort_by(|a, b|{a.id.cmp(&b.id)}); + expenses + + } + + pub fn update(&mut self, id: u8, amount: f64, tx_type: TransactionType) -> bool { + match self.values.get_mut(&id) { + Some(exp) => { + exp.amount = amount; + exp.tx_type = tx_type; + true + } + None => false, + } + // let updated_expense = Expense { + // id, + // amount, + // tx_type, + // }; + // self.values.put(id) + } + + pub fn delete(&mut self, id: u8) -> bool { + self.values.remove(&id).is_some() + } + + + pub fn save_to_file(&self, filename: &str) { + let mut file = File::create(filename).expect("Could not create file"); + + for expense in self.values.values() { + let line = format!("ID: {}, Name: {}, Amount: {:.2}, Type: {:?}\n", + expense.id, expense.name, expense.amount, expense.tx_type); + file.write_all(line.as_bytes()).expect("Could not write to file"); + } + } +} \ No newline at end of file diff --git a/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/stephen_expences.txt b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/stephen_expences.txt new file mode 100644 index 0000000..15371be --- /dev/null +++ b/submissions/week-2/day-5/Stephen-Ngozi-Merkle-Tree/stephen_expences.txt @@ -0,0 +1,2 @@ +ID: 2, Name: Beans, Amount: 5000.00, Type: Credit +ID: 1, Name: Rice, Amount: 20000.00, Type: Credit diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/.gitignore b/submissions/week-3/day-3/stephenngozi-build-cli-project/.gitignore new file mode 100644 index 0000000..c41cc9e --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/.gitignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/Cargo.lock b/submissions/week-3/day-3/stephenngozi-build-cli-project/Cargo.lock new file mode 100644 index 0000000..0677c71 --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "stephenngozi-build-cli-project" +version = "0.1.0" diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/Cargo.toml b/submissions/week-3/day-3/stephenngozi-build-cli-project/Cargo.toml new file mode 100644 index 0000000..e5c586f --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "stephenngozi-build-cli-project" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/output.txt b/submissions/week-3/day-3/stephenngozi-build-cli-project/output.txt new file mode 100644 index 0000000..465ad89 --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/output.txt @@ -0,0 +1,4 @@ + searching for to +In File poem.txt +Are you nobody, too? +How dreary to be somebody! diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/poem.txt b/submissions/week-3/day-3/stephenngozi-build-cli-project/poem.txt new file mode 100644 index 0000000..3a260bf --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! \ No newline at end of file diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/src/lib.rs b/submissions/week-3/day-3/stephenngozi-build-cli-project/src/lib.rs new file mode 100644 index 0000000..841aadc --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/src/lib.rs @@ -0,0 +1,106 @@ + +use std::fs; +use std::error::Error; +use std::env; + + + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.filename)?; + + let results = if config.case_sensitive { + search(&config.query, &contents) + }else { + search_case_insensitive(&config.query, &contents) + }; + + for line in results{ + println!("{}", line); + + } + + Ok(()) +} + +pub struct Config { + pub query : String, + pub filename : String, + pub case_sensitive: bool, +} + +impl Config { + + pub fn new (args: &[String]) -> Result { + + if args.len() < 3 { + return Err("not enough arguments"); + } + let query = args[1].clone(); + + let filename = args[2].clone(); + + let case_sensitive = env::var("CASE_INSENSITIVE").is_err(); + + Ok(Config{query, filename,case_sensitive }) + } +} + +pub fn search<'a>(query: &str, contents: & 'a str) -> Vec<& 'a str>{ + + let mut results = Vec::new(); + for line in contents.lines(){ + if line.contains(query){ + results.push(line); + } + } + + results +} + + +pub fn search_case_insensitive <'a> (query: &str, contents: & 'a str)-> Vec<&'a str> { + let query = query.to_lowercase(); + + let mut results = Vec::new(); + + for line in contents.lines(){ + if line.to_lowercase().contains(&query){ + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ + Rust: + safe, fast, productive. + Pick three. + Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ + Rust: + safe, fast, productive. + Pick three. + Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } + +} \ No newline at end of file diff --git a/submissions/week-3/day-3/stephenngozi-build-cli-project/src/main.rs b/submissions/week-3/day-3/stephenngozi-build-cli-project/src/main.rs new file mode 100644 index 0000000..15fdc62 --- /dev/null +++ b/submissions/week-3/day-3/stephenngozi-build-cli-project/src/main.rs @@ -0,0 +1,28 @@ +use std::env; +use std::process; +use stephenngozi_build_cli_project::Config; + + +fn main() { + + let args: Vec = env::args().collect(); + + let config = Config::new(&args).unwrap_or_else(|err |{ + eprintln!("Problem parsing argumemts: {}", err); + process::exit(1); + }); + + + println!(" searching for {}", config.query); + println!("In File {}", config.filename); + + if let Err(e) = stephenngozi_build_cli_project::run(config){ + eprintln!("Application Error: {}", e); + process::exit(1); + } + +} + + + + diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/.gitignore b/submissions/week-4/day-1/stephen-ngozi-blog-project/.gitignore new file mode 100644 index 0000000..1212440 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/.gitignore @@ -0,0 +1,3 @@ +/target +.env* +myown.md \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/Cargo.lock b/submissions/week-4/day-1/stephen-ngozi-blog-project/Cargo.lock new file mode 100644 index 0000000..1a54138 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/Cargo.lock @@ -0,0 +1,2604 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +dependencies = [ + "serde", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[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 = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", + "wasip3", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "bytes", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "js-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.182" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libredox" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +dependencies = [ + "bitflags", + "libc", + "redox_syscall 0.7.1", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +dependencies = [ + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "openssl" +version = "0.10.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_syscall" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35985aa610addc02e24fc232012c86fd11f14111180f902b67e2d5331f8ebf2b" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" + +[[package]] +name = "rsa" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlx" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" +dependencies = [ + "base64", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.15.5", + "hashlink", + "indexmap", + "log", + "memchr", + "native-tls", + "once_cell", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" +dependencies = [ + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "bytes", + "chrono", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" +dependencies = [ + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "thiserror", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "stephen-ngozi-blog-project" +version = "0.1.0" +dependencies = [ + "axum", + "chrono", + "dotenvy", + "secrecy", + "serde", + "serde_json", + "sqlx", + "thiserror", + "tokio", + "tracing", + "tracing-subscriber", + "uuid", +] + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.116" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df424c70518695237746f84cede799c9c58fcb37450d7b23716568cc8bc69cb" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tempfile" +version = "3.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" +dependencies = [ + "fastrand", + "getrandom 0.4.1", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" +dependencies = [ + "getrandom 0.4.1", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "whoami" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" +dependencies = [ + "libredox", + "wasite", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/Cargo.toml b/submissions/week-4/day-1/stephen-ngozi-blog-project/Cargo.toml new file mode 100644 index 0000000..dc96b1b --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "stephen-ngozi-blog-project" +version = "0.1.0" +edition = "2024" + +[dependencies] +tokio = { version = "1.28.0", features = ["full"] } +axum = "0.8.8" +dotenvy = "0.15.7" +thiserror = "2.0.18" +tracing= "0.1.44" +tracing-subscriber = {version = "0.3.22", features = ["fmt", "env-filter"]} +uuid = { version = "1.4.0", features = ["v4", "serde"] } +serde = { version = "1.0.228", features = ["derive"] } +serde_json = "1.0.149" +chrono = { version = "0.4.43", features = ["serde"] } +sqlx = { version = "0.8", features = [ + "postgres", + "runtime-tokio-native-tls", + "macros", + "migrate", + "uuid", + "chrono", + "json", +] } +secrecy = "0.10.3" \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/app.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/app.rs new file mode 100644 index 0000000..650be8d --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/app.rs @@ -0,0 +1,31 @@ +use std::net::{Ipv6Addr, SocketAddr}; +use tokio::net::TcpListener; +use crate::router::create_app; +use crate::error::AppError; + + +pub fn get_env_vars(key: String) -> Result +where + T: std::str::FromStr, + T::Err: std::fmt::Display, +{ + let value = std::env::var(&key).map_err(|_| AppError::MissingEnvironmentVarible(key))?; + value + .parse::() + .map_err(|err| AppError::ParsingError(err.to_string())) + + +} + +pub async fn serve() { + let port: u16 = get_env_vars::("PORT".to_string()).unwrap_or(8080); + let addr = SocketAddr::from((Ipv6Addr::UNSPECIFIED, port)); + let listener = TcpListener::bind(addr) + .await + .expect("Failed to bind address"); + + tracing::info!("Server is listening on: {}", listener.local_addr().unwrap()); + + let app = create_app(); + axum::serve(listener, app).await.unwrap(); +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/app_state.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/app_state.rs new file mode 100644 index 0000000..ee87f2f --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/app_state.rs @@ -0,0 +1,31 @@ +use sqlx::PgPool; +use std::sync::Arc; + + + +#[derive(Debug,Clone)] + +// pub struct AppState { +// pub db_pool: PgPool, +// } +pub struct AppState { + pub authors: Arc>>, + pub posts: Arc>>, + // next_id: Arc>, +} + +impl AppState { + pub fn new() -> Self { + Self { + authors: Arc::new(RwLock::new(seed_authors())), + posts: Arc::new(RwLock::new(HashMap::new())), + // next_id: Arc::new(RwLock::new(0u64)), + } + } +} + +impl Default for AppState { + fn default() -> Self { + Self::new() + } +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/config.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/config.rs new file mode 100644 index 0000000..ba711e5 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/config.rs @@ -0,0 +1,49 @@ +use crate::error::AppError; +use sqlx; + +pub struct AppConfig { + pub database_url: String, + pub server_port: u16, +} + +impl AppConfig { + pub fn from_env() -> Result { + let database_url = get_env_vars::("DATABASE_URL")?; + let server_port = get_env_vars::("SERVER_PORT")?; + Ok(Self { + database_url, + server_port, + }) + } +} + +pub async fn connect_db(database_url: &str) -> Result { + println!("Connecting to database at {}", database_url); + let pg_pool: sqlx::Pool = sqlx::postgres::PgPoolOptions::new() + .connect(database_url) + .await + .map_err(|err| AppError::NotFound(err.to_string()))?; + + sqlx::migrate!("./migrations") + .run(&pg_pool) + .await + .map_err(|err| AppError::InternalServerError(err.to_string()))?; + + Ok(pg_pool) +} + +// for set up and environment variables +fn get_env_vars(key: &str) -> Result +where + T: std::str::FromStr, + T::Err: std::fmt::Display, +{ + let value = + std::env::var(key).map_err(|_| AppError::MissingEnvironmentVarible(key.to_string()))?; + value.parse::().map_err(|e| { + AppError::ParsingError(format!( + "Failed to parse environment variable '{}': {}", + key, e + )) + }) +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/error.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/error.rs new file mode 100644 index 0000000..9b81a71 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/error.rs @@ -0,0 +1,32 @@ +use thiserror::Error; +use axum::{Json, http::StatusCode, response::{IntoResponse}}; +use serde_json::json; + + +#[derive(Debug, Error)] +pub enum AppError { + #[error("Resource not found")] + NotFound, + #[error("Internal Server Error: {0}")] + InternalServerError(String), + #[error("Invalid Input, cannot be processed: {field} - {message}")] + UnProcessableEntity { field: String, message: String }, + #[error("Environement Variable is missing: {0}")] + MissingEnvironmentVarible(String), + #[error("Failed to Parse: {0}")] + ParsingError(String), +} + + +impl IntoResponse for AppError { + fn into_response(self) -> axum::response::Response { + let status = match self { + AppError::NotFound => StatusCode::NOT_FOUND, + AppError::UnProcessableEntity { .. } => StatusCode::UNPROCESSABLE_ENTITY, + AppError::ParsingError(_) => StatusCode::BAD_REQUEST, + _ => StatusCode::INTERNAL_SERVER_ERROR, + }; + + (status, Json(json!({ "error": self.to_string() }))).into_response() + } +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/handlers.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/handlers.rs new file mode 100644 index 0000000..12fbd88 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/handlers.rs @@ -0,0 +1,76 @@ + +use crate::services; +use crate::error::AppError; +use serde_json::json; +use crate::models::{AppState, AuthorList, BlogPost, CreatePostRequest, UpdatePostRequest}; +use axum::{Json, extract::{Path,State}, http::StatusCode, response::{IntoResponse}}; +use uuid::Uuid; + +pub async fn health_handler()-> impl IntoResponse { + ( + StatusCode::OK, + Json(json!({ + "status": "ok", + "message": "Server is running" + })), + ) + +} + + + +pub async fn health() -> &'static str { + "Hello, World!, app is working fine" +} + + +pub async fn get_authors(State(state): State) -> Json { + Json(services::fetch_all_authors(&state).await) +} + +pub async fn get_author_by_id( + State(state): State, + Path(id): Path, +) -> Result { + let author = services::fetch_author_by_id(&state, id).await?; + Ok((StatusCode::OK, Json(json!({ "data": author })))) +} + + +pub async fn get_posts(State(state): State) -> impl IntoResponse { + let posts = services::fetch_all_posts(&state, None).await; + Json(posts) +} + +pub async fn get_post( + State(state): State, + Path(id): Path, +) -> Result, AppError> { + let post = services::fetch_post_by_id(&state, id).await?; + Ok(Json(post)) +} + +pub async fn create_post( + State(state): State, + Json(payload): Json, +) -> Result<(StatusCode, Json), AppError> { + let post = services::insert_post(&state, payload).await?; + Ok((StatusCode::CREATED, Json(post))) +} + +pub async fn update_post( + State(state): State, + Path(id): Path, + Json(payload): Json, +) -> Result, AppError> { + let post = services::modify_post(&state, id, payload).await?; + Ok(Json(post)) +} + +pub async fn delete_post( + State(state): State, + Path(id): Path, +) -> Result { + services::remove_post(&state, id).await?; + Ok(StatusCode::NO_CONTENT) +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/main.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/main.rs new file mode 100644 index 0000000..3bfc74f --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/main.rs @@ -0,0 +1,104 @@ + +mod app; +mod models; +mod router; +mod handlers; +mod error; +mod services; +mod config; + +// use handlers::{get_authors, get_author_by_id}; +use serde::Serialize; +use axum::{response::IntoResponse, Json, http::StatusCode}; + + +use tracing_subscriber::{EnvFilter, fmt}; + + +fn trace_setup() { + let env_filter: EnvFilter = + EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")); + fmt() + .with_target(false) + .pretty() + .with_env_filter(env_filter) + .init(); + + +} + + + + + + + + + + + + + + + +// async fn connect_db() -> Result { +// let db_url = get_env_vars::("DATABASE_URL".to_string()).unwrap(); + +// let pg_pool: sqlx::Pool = sqlx::postgres::PgPoolOptions::new() +// .connect(&db_url) +// .await +// .map_err(|_| AppError::NotFound)?; + +// sqlx::migrate!("./migrations") +// .run(&pg_pool) +// .await +// .map_err(|err| AppError::InternalServerError(err.to_string()))?; + +// // if let Ok(db_url) = db_url { +// // tracing::info!("Connecting to database at: {}", db_url); +// // } else { +// // tracing::error!("Database URL is not set in environment variables"); +// // } + +// Ok(pg_pool) +// } + + + + + + +#[derive(Serialize)] +struct HealthResponse { + status: String, + message : String +} + +async fn root_handler() -> impl IntoResponse { + let response = HealthResponse { + status: "ok". to_string(), + message: "Welcome to my Blog Api".to_string(), + }; (StatusCode::OK, Json(response)) +} + + + + + + + + + + + + + + + + +#[tokio::main] +async fn main() { + dotenvy::dotenv().ok(); + trace_setup(); + app::serve().await; +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/models.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/models.rs new file mode 100644 index 0000000..6909a15 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/models.rs @@ -0,0 +1,106 @@ +use std::{collections::HashMap,sync::Arc}; +use chrono::{DateTime, Utc}; +use uuid::Uuid; +use ::serde::{Deserialize, Serialize}; +use tokio:: sync::RwLock; +// use axum::{Json, Router, extract::{Path,State}, http::StatusCode, response::{IntoResponse}, routing::get}; + + + +// Author +#[derive(Serialize, Deserialize, Clone)] +pub struct Author { + pub id: Uuid, + pub name: String, + pub email: String, +} + +impl Author { + pub fn new(id: Uuid, name: String, email: String) -> Self { + Self { id, name, email } + } +} + + + +#[derive(Serialize)] +pub struct AuthorList { + pub data: Vec, + pub total: usize, +} + +// BlogPost +#[derive(Debug, Clone, Serialize,Deserialize)] +pub struct BlogPost { + pub id:Uuid, + pub title: String, + pub content: String, + pub author_id: uuid::Uuid, + #[serde(with = "chrono::serde::ts_seconds")] + pub created_at: DateTime, + #[serde(with = "chrono::serde::ts_seconds")] + pub updated_at: DateTime +} + +// Request DTOs + +#[derive(Debug, Deserialize)] +pub struct CreatePostRequest { + + pub title: String, + pub content: String, + pub author_id: Uuid, + +} +#[derive(Debug, Deserialize)] +pub struct UpdatePostRequest { + + pub title: Option, + pub content: Option, + pub author_id: Option, + +} + +// AppState + + + +// pub async fn get_author_by_id(&self, author_id: u16) -> Option { +// let authors = self.authors.read().await; +// authors.iter().find(|a| a.id == author_id).cloned() +// } + + + + + +fn seed_authors() -> HashMap { + let authors = vec![ + Author::new( + Uuid::new_v4(), + "Emeka Allison".to_string(), + "emekaallison4@gmail.com".to_string(), + ), + Author::new( + Uuid::new_v4(), + "John Doe".to_string(), + "johndoe@mail.com".to_string(), + ), + ]; + + authors.into_iter().map(|a| (a.id, a)).collect() +} + + +// pub async fn find_posts(&self, author_id: Option) -> Vec { +// let posts = self.posts.read().await; +// match author_id { +// None => posts.clone(), +// Some(id) => posts +// .iter() +// .filter(|p| p.author_id == id) +// .cloned() +// .collect(), +// } +// } +// } \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/router.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/router.rs new file mode 100644 index 0000000..ee37e54 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/router.rs @@ -0,0 +1,19 @@ +use axum::{ Router, routing::get}; +use crate::handlers::{health_handler, get_posts,create_post,get_post,update_post,delete_post }; +use crate::models::{AppState}; +use crate::root_handler; + + + +pub fn create_app() -> Router { + + let state = AppState::new(); + + Router::new() + + .route("/", get(root_handler)) + .route("/health", get(health_handler)) + .route("/posts", get(get_posts).post(create_post)) + .route("/posts/{id}", get(get_post).put(update_post).delete(delete_post),) + .with_state(state) +} \ No newline at end of file diff --git a/submissions/week-4/day-1/stephen-ngozi-blog-project/src/services.rs b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/services.rs new file mode 100644 index 0000000..10cd689 --- /dev/null +++ b/submissions/week-4/day-1/stephen-ngozi-blog-project/src/services.rs @@ -0,0 +1,165 @@ + +use uuid::Uuid; +use crate::models::{Author, AuthorList, AppState, BlogPost, CreatePostRequest, UpdatePostRequest}; +use crate::error::AppError; +use axum::http::StatusCode; + +pub async fn fetch_all_authors(state: &AppState) -> AuthorList { + let authors = state.authors.read().await; + let data: Vec = authors + .iter() + .map(|(_, a)| Author { + id: a.id, + name: a.name.clone(), + email: a.email.clone(), + }) + .collect(); + let total = data.len(); + AuthorList { data, total } +} + +pub async fn fetch_author_by_id(state: &AppState, id: Uuid) -> Result { + let authors = state.authors.read().await; + authors + .get(&id) + .cloned() + .ok_or(AppError::NotFound) +} + + +pub async fn insert_post ( + state: &AppState, + payload: CreatePostRequest,) + -> Result + +{ + if payload.title.trim().is_empty() { + return Err(AppError::UnProcessableEntity { + field: "title".to_string(), + message: "Title cannot be empty".to_string(), + + + }); + } + if payload.content.trim().is_empty() { + return Err(AppError::UnProcessableEntity { + field: "content".to_string(), + message: "Content cannot be empty".to_string(), + + + + }); + } + + + let id = Uuid::new_v4(); + let now = chrono::Utc::now(); + + + let post = BlogPost { + id, + title: payload.title, + content: payload.content, + author_id: payload.author_id, + created_at: now, + updated_at:now + }; + + let mut posts = state.posts.write().await; + posts.insert(id, post.clone()); + + Ok(post) + + +} + +// pub async fn get_post ( +// State(state): State,Path(id): Path, +// ) -> Result, AppError> { +// let posts = state.posts.read().await; + +// match posts.get(&id) { +// Some(post) => Ok(Json(post.clone())), +// None => Err(AppError::NotFound), + +// } +// } + +pub async fn fetch_post_by_id(state: &AppState, id: Uuid) -> Result { + let posts = state.posts.read().await; + posts.get(&id).cloned().ok_or(AppError::NotFound) +} + +// Get all Posts + + +pub async fn fetch_all_posts(state: &AppState, author_id: Option) -> Vec { + let posts = state.posts.read().await; + match author_id { + None => posts.values().cloned().collect(), + Some(id) => posts + .values() + .filter(|p| p.author_id == id) + .cloned() + .collect(), + } +} +// pub async fn fetch_all_posts(State(state): State) -> impl IntoResponse{ +// let posts = state.posts.read().await ; +// let post_list: Vec = posts.values().cloned().collect(); +// Json(post_list) +// } + + + +pub async fn modify_post ( + state: &AppState, + id: Uuid, + payload: UpdatePostRequest, + )-> Result { + + let mut posts = state.posts.write().await; + + let post = posts.get_mut(&id).ok_or(AppError::NotFound)?; + + if let Some(title) = payload.title { + if title.trim().is_empty() { + return Err(AppError::UnProcessableEntity { + field: "title".into(), + message: "Title cannot be empty".into(), + }); + } + post.title = title; + } + + if let Some(content) = payload.content { + if content.trim().is_empty() { + return Err(AppError::UnProcessableEntity { + field: "content".into(), + message: "Content cannot be empty".into(), + }); + } + post.content = content; + } + + if let Some(author_id) = payload.author_id { + post.author_id = author_id; + } + + post.updated_at = chrono::Utc::now(); + + Ok(post.clone()) + +} + + +pub async fn remove_post ( + state: &AppState, + id: Uuid, + )-> Result { + + let mut posts = state.posts.write().await; + + posts.remove(&id).map(|_| StatusCode::NO_CONTENT).ok_or(AppError::NotFound) + +} diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/.gitignore b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/.gitignore new file mode 100644 index 0000000..c41cc9e --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/.gitignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/Cargo.lock b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/Cargo.lock new file mode 100644 index 0000000..140f83e --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/Cargo.lock @@ -0,0 +1,723 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.59.0", +] + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width", + "windows-sys 0.59.0", +] + +[[package]] +name = "dialoguer" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" +dependencies = [ + "console", + "shell-words", + "tempfile", + "thiserror", + "zeroize", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "getrandom" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", + "wasip3", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.182" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "shell-words" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" + +[[package]] +name = "stephenngozi-rust-scaffold-cli" +version = "0.1.0" +dependencies = [ + "clap", + "colored", + "dialoguer", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" +dependencies = [ + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/Cargo.toml b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/Cargo.toml new file mode 100644 index 0000000..5b2df30 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "stephenngozi-rust-scaffold-cli" +version = "0.1.0" +edition = "2024" + +[dependencies] +clap = { version = "4", features = ["derive"] } + +dialoguer = "0.11" +colored = "2" + +[[bin]] +name = "stephenngozi-rust-cli-scaffold" +path = "src/main.rs" diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/cli.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/cli.rs new file mode 100644 index 0000000..3222534 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/cli.rs @@ -0,0 +1,22 @@ +use clap::{Parser, Subcommand}; + + + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +pub struct Cli { + #[command(subcommand)] + pub command: Option, + + #[arg(short, long)] + pub name: Option, + + #[arg(short, long)] + pub framework: Option, +} + +#[derive(Subcommand, Debug)] +pub enum SubCommand { + New , + Delete , +} \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/framework.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/framework.rs new file mode 100644 index 0000000..541adc7 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/framework.rs @@ -0,0 +1,221 @@ +use crate::templates::{axum, actix}; + + + +#[derive(Debug)] +pub enum Framework { + Axum, + Actix, +} + +impl Framework { + pub fn from_str(s: &str) -> Option { + match s.to_lowercase().as_str() { + "axum" => Some(Framework::Axum), + "actix" => Some(Framework::Actix), + _ => None, + } + } + pub fn display_name(&self) -> &str { + match self { + Framework::Axum => "Axum", + Framework::Actix => "Actix-web", + } + } + + // Returns the Cargo.toml [dependencies] section for each framework. + pub fn dependencies(&self) -> String { + match self { + Framework::Axum => { + r#"[dependencies] +# Core web framework built on Tokio — fast and ergonomic +axum = "0.7" + +# Async runtime — required for all async Rust code +tokio = { version = "1", features = ["full"] } + +# Tower middleware ecosystem (axum is built on top of tower) +tower = "0.4" +tower-http = { version = "0.5", features = ["cors", "trace"] } + +# Serialization / Deserialization — JSON support +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +# Environment variable management +dotenv = "0.15" + +# Logging +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +"# + .to_string() + } + + Framework::Actix => { + r#"[dependencies] +# Core web framework — high-performance, battle-tested +actix-web = "4" + +# Tokio async runtime (actix-web uses it under the hood) +tokio = { version = "1", features = ["full"] } + +# Middleware utilities for actix-web +actix-cors = "0.7" + +# Serialization / Deserialization — JSON support +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +# Environment variable management +dotenv = "0.15" + +# Logging +env_logger = "0.11" +log = "0.4" +"# + .to_string() + } + } + } + + // Returns the content of main.rs for each framework. + pub fn main_rs_content(&self, project_name: &str) -> String { + match self { + Framework::Axum => format!( + r#"mod handlers; +mod models; +mod router; +mod services; + +use tracing_subscriber::{{EnvFilter, fmt}}; + +// CONCEPT: #[tokio::main] is a macro that sets up the Tokio async runtime. +// Without it, you can't use `async fn main()`. +#[tokio::main] +async fn main() {{ + // Initialize tracing/logging + fmt() + .with_env_filter(EnvFilter::from_default_env()) + .init(); + + // Load environment variables from .env file + dotenv::dotenv().ok(); + + tracing::info!("Starting {} server...", "{project_name}"); + + // Build the router — all routes are registered in router/mod.rs + let app = router::create_router(); + + // Bind to address and start serving + let listener = tokio::net::TcpListener::bind("0.0.0.0:3000") + .await + .expect("Failed to bind to port 3000"); + + tracing::info!("🚀 Server running at http://0.0.0.0:3000"); + + axum::serve(listener, app) + .await + .expect("Server error"); +}} +"#, + project_name = project_name + ), + + Framework::Actix => format!( + r#"mod handlers; +mod models; +mod router; +mod services; + +use actix_web::{{App, HttpServer}}; + +// CONCEPT: #[actix_web::main] sets up the Actix async runtime. +// Actix has its own runtime built on top of Tokio. +#[actix_web::main] +async fn main() -> std::io::Result<()> {{ + // Initialize logger + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + // Load environment variables from .env file + dotenv::dotenv().ok(); + + log::info!("Starting {} server...", "{project_name}"); + log::info!("🚀 Server running at http://0.0.0.0:8080"); + + // HttpServer::new takes a closure that returns an App + // The move || closure captures environment for thread safety + HttpServer::new(move || {{ + App::new() + .configure(router::configure_routes) + }}) + .bind("0.0.0.0:8080")? + .run() + .await +}} +"#, + project_name = project_name + ), + } + } + + // Returns the router/mod.rs content + pub fn router_mod_content(&self) -> String { + match self { + Framework::Axum => { + r#"use axum::Router; +// Import your handlers here as you build them out. +// Example: use crate::handlers::health::health_check; + +/// Creates and returns the main application Router. +/// Add all your routes here using `.route(path, method_handler)`. +pub fn create_router() -> Router { + Router::new() + // Example routes — uncomment and expand as needed: + // .route("/health", axum::routing::get(handlers::health_check)) + // .route("/api/v1/users", axum::routing::get(handlers::users::list_users)) +} +"# + .to_string() + } + + Framework::Actix => { + r#"use actix_web::web; +// Import your handlers here as you build them out. +// Example: use crate::handlers::health::health_check; + +/// Configures all routes for the Actix-web application. +/// Called in main.rs inside App::new().configure(...) +pub fn configure_routes(cfg: &mut web::ServiceConfig) { + cfg + // Example routes — uncomment and expand as needed: + // .service(web::resource("/health").route(web::get().to(handlers::health_check))) + // .service( + // web::scope("/api/v1") + // .service(web::resource("/users").route(web::get().to(handlers::users::list_users))) + // ) + ; +} +"# + .to_string() + } + } + } + + + // Returns the handlers/mod.rs content + pub fn handlers_mod_content(&self) -> &'static str { + match self { + Framework::Axum => axum::HANDLERS_MOD, + Framework::Actix => actix::HANDLERS_MOD, + } + } + + // Returns the .env content + pub fn env_content(&self) -> &'static str { + match self { + Framework::Axum => "RUST_LOG=info\nPORT=3000\n", + Framework::Actix => "RUST_LOG=info\nPORT=8080\n", + } + } +} \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/handlers.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/handlers.rs new file mode 100644 index 0000000..abec704 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/handlers.rs @@ -0,0 +1,118 @@ + + +use colored::*; +use dialoguer::{theme::ColorfulTheme, Input, Select}; + +use crate::framework::Framework; + + +// Prompt user for the project name + + +pub fn prompt_project_name(provided: Option) -> String { + provided.unwrap_or_else(|| { + Input::with_theme(&ColorfulTheme::default()) + .with_prompt("Project name") + .validate_with(|input: &String| { + if input.is_empty() { + Err("Project name cannot be empty".to_string()) + } else { + Ok(()) + } + }) + .interact_text() + .expect("Failed to read project name") + }) +} + + +// Prompt user to choose a framework +pub fn prompt_framework(provided: Option) -> Framework { + if let Some(f) = provided { + Framework::from_str(&f).unwrap_or_else(|| { + eprintln!( + "{} Unknown framework '{}'. Use 'axum' or 'actix'.", + "Error:".red().bold(), + f + ); + std::process::exit(1); + }) + } else { + let frameworks = vec!["Axum", "Actix-web"]; + let selection = Select::with_theme(&ColorfulTheme::default()) + .with_prompt("Choose a framework") + .items(&frameworks) + .default(0) + .interact() + .expect("Failed to read selection"); + match selection { + 0 => Framework::Axum, + 1 => Framework::Actix, + _ => unreachable!("Invalid selection"), + } + } +} + +// Print the success summary after scaffolding completes +pub fn print_success_summary(project_name: &str) { + println!(); + println!(" {}", " Project scaffolded successfully!".green().bold()); + println!(); + println!(" {}", "Generated structure:".bold()); + println!(" {}/", project_name.bright_cyan()); + println!(" ├── {}", "Cargo.toml".yellow()); + println!(" ├── {}", ".env".yellow()); + println!(" ├── {}", ".gitignore".yellow()); + println!(" └── src/"); + println!(" ├── {}", "main.rs".yellow()); + println!(" ├── handlers/"); + println!(" │ └── {}", "mod.rs".yellow()); + println!(" ├── models/"); + println!(" │ └── {}", "mod.rs".yellow()); + println!(" ├── services/"); + println!(" │ └── {}", "mod.rs".yellow()); + println!(" └── router/"); + println!(" └── {}", "mod.rs".yellow()); + + println!(); + println!(" {}", "Next steps:".bold()); + println!(" {} cd {}", "$".dimmed(), project_name.bright_cyan()); + println!(" {} cargo build", "$".dimmed()); + println!(" {} cargo run", "$".dimmed()); + println!(); +} + + +// Prompt user to confirm deletion +pub fn prompt_delete_confirmation(project_name: &str) -> bool { + use dialoguer::Confirm; + + println!(); + Confirm::with_theme(&ColorfulTheme::default()) + .with_prompt(format!( + "Are you sure you want to delete '{}'? This cannot be undone.", + project_name.bright_cyan() + )) + .default(false) + .interact() + .expect("Failed to read confirmation") +} + +// Print the deletion success message +pub fn print_delete_success(project_name: &str) { + println!(); + println!( + " {} '{}' has been deleted.", + "🗑️ Deleted:".red().bold(), + project_name.bright_cyan() + ); + println!(); +} + + +// Print the deletion cancelled message +pub fn print_delete_cancelled() { + println!(); + println!(" {}", "Deletion cancelled.".dimmed()); + println!(); +} diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/main.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/main.rs new file mode 100644 index 0000000..ada6164 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/main.rs @@ -0,0 +1,64 @@ +mod cli; +mod framework; +mod handlers; +mod services; +mod templates; + +use clap::Parser; +use colored::*; + +use cli::{Cli, SubCommand}; + + +fn main() -> Result<(), Box> { + + let cli = Cli::parse(); + + println!(); + println!( + "{}", + " 🦀 Ngozi-Stephen- rust-scaffold — Backend Project Generator " + .black() + .on_yellow() + .bold() + ); + println!(); + + + + match cli.command.unwrap_or(SubCommand::New) { + SubCommand::New => { + let project_name = handlers::prompt_project_name(cli.name); + + let framework = handlers::prompt_framework(cli.framework); + + + // Run the scaffolder! + + services::scaffold_project(&project_name, &framework)?; + + + // Print the success summary + + handlers::print_success_summary(&project_name); + + + } + SubCommand::Delete => { + + + let project_name = handlers::prompt_project_name(cli.name); + + + // Ask the user to confirm before doing anything destructive + if handlers::prompt_delete_confirmation(&project_name) { + services::delete_project(&project_name)?; + handlers::print_delete_success(&project_name); + } else { + handlers::print_delete_cancelled(); + } + } + } + + Ok(()) +} \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/services.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/services.rs new file mode 100644 index 0000000..1cb7f24 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/services.rs @@ -0,0 +1,126 @@ +// ============================================================ +// services.rs — File writing and scaffolding business logic +// ============================================================ + + +use std::fs; +use std::path::Path; +use colored::*; + +use crate::framework::Framework; +use crate::templates::{self}; + + +pub fn scaffold_project( + project_name: &str, + framework: &Framework, +) -> Result<(), Box> { + let _root = Path::new(project_name); + println!(); + println!( + "{}", + format!(" Scaffolding {} with {} ", project_name, framework.display_name()) + .black() + .on_bright_cyan() + .bold() + ); + println!(); + + // Create directory structure + + let dirs = [ + format!("{}/src/handlers", project_name), + format!("{}/src/models", project_name), + format!("{}/src/services", project_name), + format!("{}/src/router", project_name), + ]; + + // fs::create_dir_all creates ALL directories in the path, + + for dir in &dirs { + fs::create_dir_all(dir)?; + println!(" {} {}", "Created".green().bold(), dir.dimmed()); + } + + + // Cargo.toml + + let cargo_toml = format!( + r#"[package] +name = "{name}" +version = "0.1.0" +edition = "2021" + +{deps}"#, + name = project_name, + deps = framework.dependencies() + ); + + write_file(&format!("{}/Cargo.toml", project_name), &cargo_toml)?; + // Write .env file + + write_file(&format!("{}/.env", project_name), framework.env_content())?; + + // Write .gitignore + + write_file(&format!("{}/.gitignore", project_name), templates::GITIGNORE)?; + + + // Write src/main.rs + + write_file( + &format!("{}/src/main.rs", project_name), + &framework.main_rs_content(project_name), + )?; + + + // Write module mod.rs files + + let router_mod = framework.router_mod_content(); + let module_files: Vec<(String, &str)> = vec![ + ( + format!("{}/src/handlers/mod.rs", project_name), + framework.handlers_mod_content(), + ), + ( + format!("{}/src/services/mod.rs", project_name), + templates::SERVICES_MOD, + ), + ( + format!("{}/src/models/mod.rs", project_name), + templates::MODELS_MOD, + ), + ( + format!("{}/src/router/mod.rs", project_name), + &router_mod, + ), + ]; + + for (path, content) in &module_files { + write_file(path, content)?; + } + + Ok(()) +} + + + +pub fn write_file(path: &str, content: &str) -> Result<(), Box> { + fs::write(path, content)?; + println!(" {} {}", "✓ Wrote".green().bold(), path.dimmed()); + Ok(()) +} + + + +// Delete a scaffolded project directory +pub fn delete_project(project_name: &str) -> Result<(), Box> { + let path = std::path::Path::new(project_name); + + if !path.exists() { + return Err(format!("Project '{}' not found in the current directory.", project_name).into()); + } + + fs::remove_dir_all(path)?; + Ok(()) +} \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/actix.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/actix.rs new file mode 100644 index 0000000..2bb009c --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/actix.rs @@ -0,0 +1,96 @@ + + + + +pub const DEPENDENCIES: &str = r#"[dependencies] +# Core web framework — high-performance, battle-tested +actix-web = "4" + +# Tokio async runtime (actix-web uses it under the hood) +tokio = { version = "1", features = ["full"] } + +# Middleware utilities for actix-web +actix-cors = "0.7" + +# Serialization / Deserialization — JSON support +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +# Environment variable management +dotenv = "0.15" + +# Logging +env_logger = "0.11" +log = "0.4" +"#; + + +pub fn main_rs(project_name: &str) -> String { + format!( + r#"mod handlers; +mod models; +mod router; +mod services; + +use actix_web::{{App, HttpServer}}; + +// CONCEPT: #[actix_web::main] sets up the Actix async runtime. +// Actix has its own runtime built on top of Tokio. +#[actix_web::main] +async fn main() -> std::io::Result<()> {{ + // Initialize logger + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + // Load environment variables from .env file + dotenv::dotenv().ok(); + + log::info!("Starting {project_name} server..."); + log::info!("🚀 Server running at http://0.0.0.0:8080"); + + // HttpServer::new takes a closure that returns an App + // The move || closure captures environment for thread safety + HttpServer::new(move || {{ + App::new() + .configure(router::configure_routes) + }}) + .bind("0.0.0.0:8080")? + .run() + .await +}} +"#, + project_name = project_name + ) +} + +pub const ROUTER_MOD: &str = r#"use actix_web::web; +// Import your handlers here as you build them out. +// Example: use crate::handlers::health::health_check; + +/// Configures all routes for the Actix-web application. +/// Called in main.rs inside App::new().configure(...) +pub fn configure_routes(cfg: &mut web::ServiceConfig) { + cfg + // Example routes — uncomment and expand as needed: + // .service(web::resource("/health").route(web::get().to(handlers::health_check))) + // .service( + // web::scope("/api/v1") + // .service(web::resource("/users").route(web::get().to(handlers::users::list_users))) + // ) + ; +} +"#; + +pub const HANDLERS_MOD: &str = r#"// handlers/mod.rs +// This module is the entry point for all your HTTP request handlers. +// +// USAGE PATTERN: +// Create submodules for each resource, e.g.: +// pub mod health; +// pub mod users; +// +// Each handler is an async function that returns an HttpResponse. +// Example: +// pub async fn health_check() -> actix_web::HttpResponse { +// actix_web::HttpResponse::Ok().finish() +// } +"#; \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/axum.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/axum.rs new file mode 100644 index 0000000..1c953f4 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/axum.rs @@ -0,0 +1,98 @@ + + + + +pub const DEPENDENCIES: &str = r#"[dependencies] +# Core web framework built on Tokio — fast and ergonomic +axum = "0.7" + +# Async runtime — required for all async Rust code +tokio = { version = "1", features = ["full"] } + +# Tower middleware ecosystem (axum is built on top of tower) +tower = "0.4" +tower-http = { version = "0.5", features = ["cors", "trace"] } + +# Serialization / Deserialization — JSON support +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +# Environment variable management +dotenv = "0.15" + +# Logging +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +"#; + + +pub fn main_rs(project_name: &str) -> String { + format!( + r#"mod handlers; +mod models; +mod router; +mod services; + +use tracing_subscriber::{{EnvFilter, fmt}}; + +// CONCEPT: #[tokio::main] is a macro that sets up the Tokio async runtime. +// Without it, you can't use `async fn main()`. +#[tokio::main] +async fn main() {{ + // Initialize tracing/logging + fmt() + .with_env_filter(EnvFilter::from_default_env()) + .init(); + + // Load environment variables from .env file + dotenv::dotenv().ok(); + + tracing::info!("Starting {project_name} server..."); + + // Build the router — all routes are registered in router/mod.rs + let app = router::create_router(); + + // Bind to address and start serving + let listener = tokio::net::TcpListener::bind("0.0.0.0:3000") + .await + .expect("Failed to bind to port 3000"); + + tracing::info!("🚀 Server running at http://0.0.0.0:3000"); + + axum::serve(listener, app) + .await + .expect("Server error"); +}} +"#, + project_name = project_name + ) +} + +pub const ROUTER_MOD: &str = r#"use axum::Router; +// Import your handlers here as you build them out. +// Example: use crate::handlers::health::health_check; + +/// Creates and returns the main application Router. +/// Add all your routes here using `.route(path, method_handler)`. +pub fn create_router() -> Router { + Router::new() + // Example routes — uncomment and expand as needed: + // .route("/health", axum::routing::get(handlers::health_check)) + // .route("/api/v1/users", axum::routing::get(handlers::users::list_users)) +} +"#; + +pub const HANDLERS_MOD: &str = r#"// handlers/mod.rs +// This module is the entry point for all your HTTP request handlers. +// +// USAGE PATTERN: +// Create submodules for each resource, e.g.: +// pub mod health; +// pub mod users; +// +// Each handler receives an Axum extractor and returns a response. +// Example: +// pub async fn health_check() -> impl axum::response::IntoResponse { +// axum::http::StatusCode::OK +// } +"#; \ No newline at end of file diff --git a/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/mod.rs b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/mod.rs new file mode 100644 index 0000000..4b19a26 --- /dev/null +++ b/submissions/week-5/day-1/stephenngozi-rust-scaffold-cli/src/templates/mod.rs @@ -0,0 +1,44 @@ + + + +pub mod axum; +pub mod actix; + + +pub const SERVICES_MOD: &str = r#"// services/mod.rs +// Services contain your BUSINESS LOGIC — the core of your application. +// They are framework-agnostic: no Axum/Actix types here. +// +// USAGE PATTERN: +// Create submodules for each domain, e.g.: +// pub mod user_service; +// pub mod auth_service; +// +// Services are called FROM handlers. Example: +// pub async fn find_user_by_id(id: u64) -> Option { +// // database query logic here +// None +// } +"#; + +pub const MODELS_MOD: &str = r#"// models/mod.rs +// Models define your DATA STRUCTURES — the shape of your domain objects. +// Use serde's Serialize/Deserialize to convert to/from JSON automatically. +// +// USAGE PATTERN: +// Create submodules for each entity, e.g.: +// pub mod user; +// pub mod post; +// +// Example model: +// use serde::{Deserialize, Serialize}; +// +// #[derive(Debug, Serialize, Deserialize)] +// pub struct User { +// pub id: u64, +// pub name: String, +// pub email: String, +// } +"#; + +pub const GITIGNORE: &str = "/target\n.env\n"; \ No newline at end of file