Boot-Banner 0.1.1

An elegant banner library that enhances project launches with eye-catching terminal displays and helpful assistance.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 7.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 272.42 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mingtle/Boot-Banner
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mingtle

Boot-Banner

Boot-Banner is a Rust library that provides a simple way to display a banner when your application starts. It uses a procedural macro to inject banner-displaying code into your main function.

Features

  • Easy to use: Just add a single attribute to your main function
  • Customizable: Use your own banner text file
  • Error-tolerant: Continues execution even if the banner file is not found

Installation

Add this to your Cargo.toml:

[dependencies]
Boot-Banner = "0.1.0"

Usage

Create a banner.txt file in your project's root directory with your desired banner content. In your main.rs file, use the #[init] attribute on your main function:

use Boot_Banner::init;

#[init]
fn main() {
    // Your code here
    println!("Hello, world!");
}

How it works

The init attribute macro does the following:

  • Attempts to read the banner.txt file from the current directory
  • If successful, prints the banner content to the console
  • If unsuccessful (e.g., file not found), prints an error message
  • Executes the original function body

Error Handling

If the banner file cannot be read or doesn't exist, the library will print an error message but allow your application to continue running.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Authors

m1n67un

Acknowledgments

Thanks to the Rust community for providing excellent documentation and resources.