{"id":21646604,"url":"https://github.com/skn437/skn-rust-utils","last_synced_at":"2026-02-21T06:32:27.992Z","repository":{"id":243088640,"uuid":"810496445","full_name":"skn437/skn-rust-utils","owner":"skn437","description":"A Simple Utility Library For Rust","archived":false,"fork":false,"pushed_at":"2025-10-23T06:05:38.000Z","size":60,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T13:52:47.616Z","etag":null,"topics":["crates","library","rust","utility"],"latest_commit_sha":null,"homepage":"https://docs.rs/best_skn_utils/1.2.4/best_skn_utils/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skn437.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-04T20:09:26.000Z","updated_at":"2025-10-23T06:07:01.000Z","dependencies_parsed_at":"2025-04-11T19:22:10.946Z","dependency_job_id":"9663f3bd-490d-4453-afc0-6cad28c2c9a0","html_url":"https://github.com/skn437/skn-rust-utils","commit_stats":null,"previous_names":["skn437/skn-rust-utils"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/skn437/skn-rust-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-rust-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-rust-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-rust-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-rust-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skn437","download_url":"https://codeload.github.com/skn437/skn-rust-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skn437%2Fskn-rust-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29675468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crates","library","rust","utility"],"created_at":"2024-11-25T06:45:50.651Z","updated_at":"2026-02-21T06:32:27.965Z","avatar_url":"https://github.com/skn437.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SKN Rust Utility Library\n\n\u003cimg width=\"150px\" src=\"https://firebasestorage.googleapis.com/v0/b/skn-ultimate-project-la437.appspot.com/o/GitHub%20Library%2F07-Rust-SRU.svg?alt=media\u0026token=7f4940f6-d18f-46fb-88ac-e21f6bf27d89\" alt=\"rust\" /\u003e\n\n\u003e Rust\n\n[![Crates IO](https://img.shields.io/crates/v/best_skn_utils)](https://crates.io/crates/best_skn_utils) [![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)\n\n\u0026nbsp;\n\n## **_RustDocs:_**\n\n### Read the Rustdoc for the main Modules\n\n- [env](https://docs.rs/best_skn_utils/1.2.3/best_skn_utils/env/index.html)\n- [execution](https://docs.rs/best_skn_utils/1.2.3/best_skn_utils/execution/index.html)\n- [stdio](https://docs.rs/best_skn_utils/1.2.3/best_skn_utils/stdio/index.html)\n- [random](https://docs.rs/best_skn_utils/1.2.3/best_skn_utils/random/index.html)\n- [args](https://docs.rs/best_skn_utils/1.2.3/best_skn_utils/args/index.html)\n\n\u0026nbsp;\n\n## **_Introduction:_**\n\n### This is a simple Rust Library for some essential utility functions\n\n### I made this library so that I can use it in all of my rust projects without writing the same codes over and over again\n\n### The main Modules of this library are `env`, `execution`, `stdio`, `random` \u0026 `args`\n\n\u0026nbsp;\n\n## **_Details:_**\n\n### **`env` Module:**\n\n- It has 1 function which builds external config file functionality to get data from outside the program\n- `init_config` function takes generic\n- The file name is `rustenv.toml` from which you can get data after invoking the function\n- The config file `rustenv.toml` must be placed in the root directory where `Cargo.toml` file is\n- To read values from the file properly you need [serde](https://crates.io/crates/serde) crate\n- See `Usage` section to get an example of how to use it\n\n### **`execution` Module**\n\n- It has 2 functions which help to execute commands in the terminal\n- `execute_command` function can run any command in the terminal\n  - it takes the command name as first argument\n  - it takes a reference of string slice (\u0026str) array as command arguments\n- `gnome_execute_command` function can open a new gnome terminal and executes commands in it\n  - it takes only one argument which is a string slice (\u0026str)\n  - if multiple command needs to be executed then the commands must be separated by `;`\n- See `Usage` section to get an example of how to use it\n\n### **`stdio` Module**\n\n- It has 1 function which reads user input and returns it\n- `read_line` function returns String if it successfully reads the input else returns Error\n- See `Usage` section to get an example of how to use it\n\n### **`random` Module**\n\n- It has 1 function that generates random number from a given range\n- `gen_random_number` function takes two parameters to set a range. One is `low` and the other one is `high`\n- The parameters can either be `Integer` or `Float`\n- parameter `low` and `high` must be of same type i.e. you cannot set a range of say from 1 to 10.1\n- The second parameter `high` is inclusive i.e. a range of 1 and 10 will mean the range includes from 1 to 10\n- See `Usage` section to get an example of how to use it\n\n### **`args` Module**\n\n- It has 1 function that provides a collection of arguments passed in command line interface\n- `get_args` function returns a collection as a vector of String\n- See `Usage` section to get an example of how to use it\n\n\u0026nbsp;\n\n## **_Use Case:_**\n\n- Rust\n\n\u0026nbsp;\n\n## **_Requirements:_**\n\n- 💀 Minimum Rust Version: `1.80.0`\n- 💀 Crates:\n  - [serde](https://crates.io/crates/serde): `1.0.208`\n  - [num](https://crates.io/crates/num): `0.4.3`\n  - [rand](https://crates.io/crates/rand): `0.8.5`\n  - [config](https://crates.io/crates/config): `0.14.0`\n\n\u0026nbsp;\n\n## **_Usage:_**\n\n### To install the package, type the following in console\n\n\u003e ```zsh\n\u003e cargo add best_skn_utils\n\u003e ```\n\n### Inside your Rust Code, import the package like this\n\n\u003e ```rust\n\u003e use best_skn_utils::{env, execution, stdio, random, args};\n\u003e ```\n\n### Use the modules like the following (Just an example)\n\n#### (1) For `env` module, you can use like this\n\n##### **(a) Suppose the `rustenv.toml` file contains the data like this**\n\n\u003e ```toml\n\u003e [author]\n\u003e name = \"SKN\"\n\u003e email = \"skn437physx@gmail.com\"\n\u003e ```\n\n##### **(b) Then the usage of the module can be like this**\n\n\u003e ```rust\n\u003e use best_skn_utils::env::init_config;\n\u003e use serde::Deserialize;\n\u003e\n\u003e #[derive(Debug, Deserialize)]\n\u003e struct Author {\n\u003e   name: String,\n\u003e   email: String,\n\u003e }\n\u003e\n\u003e impl Author {\n\u003e   fn new() -\u003e Self {\n\u003e     Self {\n\u003e       name: String::new(),\n\u003e       email: String::new(),\n\u003e     }\n\u003e   }\n\u003e }\n\u003e\n\u003e #[derive(Debug, Deserialize)]\n\u003e struct ConfigData {\n\u003e   author: Author,\n\u003e }\n\u003e\n\u003e impl ConfigData {\n\u003e   fn new() -\u003e Self {\n\u003e     let config = init_config::\u003cSelf\u003e();\n\u003e\n\u003e     match config {\n\u003e       | Ok(value) =\u003e value,\n\u003e       | Err(e) =\u003e {\n\u003e         println!(\"Error: {}\", e);\n\u003e         Self {\n\u003e           author: Author::new(),\n\u003e         }\n\u003e       }\n\u003e     }\n\u003e   }\n\u003e }\n\u003e\n\u003e let config_data: ConfigData = ConfigData::new();\n\u003e\n\u003e println!(\"Name: {}, Email: {}\", config_data.author.name, config_data.author.email);\n\u003e ```\n\n#### (2) For `execution` module, you can use like this\n\n\u003e ```rust\n\u003e use best_skn_utils::execution::{execute_command, gnome_execute_command};\n\u003e\n\u003e execute_command(\"cargo\", \u0026[\"doc\", \"--open\"]);\n\u003e\n\u003e gnome_execute_command(\"printf 'Hello SKN! \\n'; printf 'Build was successful! ✅ \\n'; read -n 1 KEY\");\n\u003e ```\n\n#### (3) For `stdio` module, you can use like this\n\n\u003e ```rust\n\u003e use best_skn_utils::stdio::read_line;\n\u003e use std::io::Error;\n\u003e\n\u003e let input: Result\u003cString, Error\u003e = read_line(\"Write your name:\");\n\u003e\n\u003e match input {\n\u003e   | Ok(value) =\u003e println!(\"Your name: {}\", value),\n\u003e   | Err(e) =\u003e println!(\"Error: {}\", e),\n\u003e }\n\u003e ```\n\n#### (4) For `random` module, you can use like this\n\n\u003e ```rust\n\u003e use best_skn_utils::random::gen_random_number;\n\u003e\n\u003e let num1: i32 = gen_random_number(1, 10);\n\u003e let num2: f64 = gen_random_number(1.5, 7.5);\n\u003e ```\n\n#### (5) For `args` module, you can use like this\n\n\u003e ```rust\n\u003e use best_skn_utils::args::get_args;\n\u003e\n\u003e let args: Vec\u003cString\u003e = get_args();\n\u003e\n\u003e println!(\"{:?}\", args);\n\u003e ```\n\n\u0026nbsp;\n\n## **_Dedicated To:_**\n\n- 👩‍⚕️`Tanjila Hasan Trina`: The long lost love of my life. The course of nature separated us from our paths and put us in separate places far away from each other. But no matter how separated we are right now, each and every moment of mine is only dedicated to you. We may not see each other in this lifetime as it seems but I will find you again in the next life. I just want to say: `世界は残酷だ それでも君を愛すよ`\n- 💯`My Parents`: The greatest treasures of my life ever.\n\n\u0026nbsp;\n\n## **_License:_**\n\nCopyright (C) 2024 SKN Shukhan\n\nLicensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskn437%2Fskn-rust-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskn437%2Fskn-rust-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskn437%2Fskn-rust-utils/lists"}