greattraits 0.1.0

My own collection for traits extending standard library types
Documentation
  • Coverage
  • 87.5%
    7 out of 8 items documented0 out of 7 items with examples
  • Size
  • Source code size: 5.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.17 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • denizsincar29/greattraits
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • denizsincar29

greattraits

A collection of great traits extending rust's standard library.

Traits

For now, this collection includes only one trait, but I plan to add more in the future.

Pathjects:

A trait for path manipulation. (only Path, but want to extend to PathBuf). It supports several methods to open a file, delete a file, create, as well as open in bufread and bufwrite mode.

Usage

Use a simple shell command to install the crate:

cargo add greattraits

Then, you can use the trait in your code:

use greattraits::Pathjects;

fn main(){
    let folder = Path::new("myfolder");
    folder.mkdir().expect("cannot create folder");
    let txt=folder.join("hello.txt");
    let mut f=txt.create().expect("cannot create file");
    write!(f, "hello!").expect("cannot write file");
    txt.delete().expect("can't delete!");
    folder.delete().expect("can't delete folder!");
}

License

This is my hobby project and i'm still not knowledgeable about licensing. But someone told me that MIT is a good license, so I'm using it. If you have any suggestions, please let me know.