https://github.com/skn437/skn-rust-message
A Simple Message Library For Rust
https://github.com/skn437/skn-rust-message
crates library message rust
Last synced: 5 months ago
JSON representation
A Simple Message Library For Rust
- Host: GitHub
- URL: https://github.com/skn437/skn-rust-message
- Owner: skn437
- License: mit
- Created: 2024-05-12T14:23:57.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-12-17T05:13:37.000Z (7 months ago)
- Last Synced: 2025-12-27T05:24:06.418Z (6 months ago)
- Topics: crates, library, message, rust
- Language: Rust
- Homepage: https://docs.rs/best_skn_message/1.2.5/best_skn_message/
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SKN Rust Message Library

> Rust
[](https://crates.io/crates/best_skn_message) [](https://opensource.org/license/mit)
## **_RustDocs:_**
### Read the Rustdoc for the main Module
- [message](https://docs.rs/best_skn_message/1.2.5/best_skn_message/message/index.html)
## **_Introduction:_**
### This is a simple Rust Library for notification message on console
### 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
### The main Module of this library is `message` which holds 3 functions to return colored Strings & 3 functions to output formatted static String notification messages
## **_Details:_**
### **`message` Module:**
- It has 3 functions which return colored Strings as output
- error (takes 1 argument & returns a red colored String with cross mark)
- success (takes 1 argument & returns a green colored String with tick mark)
- info (takes 1 argument & returns a blue colored String with book info mark)
- It has 3 functions which outputs formatted static String notifications
- action_failure (takes 1 argument as 'action name' & outputs an action failure message)
- action_complete (takes 1 argument as 'action name' & outputs an action complete message)
- action_notify (takes 2 arguments as 'action name', 'notification info' & outputs an action info message)
- The String returned by each function, doesn't contain new line character i.e. '\n'
## **_Use Case:_**
- Rust
## **_Requirements:_**
- 💀 Minimum Rust Version: `1.80.0`
## **_Usage:_**
### To install the package, type the following in console
> ```zsh
> cargo add best_skn_message
> ```
### Inside your Rust Code, import the package like this
> ```rust
> use best_skn_message::message;
> ```
### For `Message` Module, use like the following (Just an example)
> ```rust
> let error: String = message::error("Error occurred!");
> panic!("{} \n", error);
>
> let success: String = message::success("Process completed!");
> println!("{}", success);
>
> let info: String = message::info("Process is safe to pause!");
> println!("{}", info);
>
> let failure: String = message::action_failure("Copy Files"); // Action name as argument
> panic!("{} \n", failure);
>
> let complete: String = message::action_complete("Read Config File"); // Action name as argument
> println!("{}", complete);
>
> let notify: String = message::action_notify("Run Shell Scripts", "Safe to use without error!"); // Action name & notification info message as arguments
> println!("{}", notify);
> ```
## **_Dedicated To:_**
- 👩🎨`Prodipta Das Logno` & 🧛♀️`Atoshi Sarker Prithula`: The two most special ladies of my life. My best wishes will always be with you two. May you two always be happy.
- 💯`My Parents`: The greatest treasures of my life ever.
## **_License:_**
Copyright (C) 2024 SKN Shukhan
Licensed under the MIT License