rustypath
Path crate for rust. Managing paths made easy.
Overview
Coverting and Managing paths in rust is now made easy.
Table of contents
Add to your project
Usage
use RPath;
// to create a new RPath
let rpath = new_from;
// to create from Path (std::path::Path)
let demopath = from;
let rpath = new_from_path;
// to create from PathBuf
let demopbuf = from;
let rpath = new_from_pbuf;
// join more parts to it
let new_r_path = rpath.join; //will return /abc/bca
// convert to pathbuf
let pbuf = rpath.convert_to_pathbuf;
// convert to string
let string = rpath.convert_to_string;
// convert from relpath to abspath
let abspath = rpath.expand
// convert from Option<PathBuf> to PathBuf
// suppose u get some output in Option<Pathbuf>
let pbuf = convert_optionpathbuf_to_pbuf;
// get current dir in RPath
let current_working_dir = pwd;
// get home dir in RPath
let homedir = gethomedir;
// get clone
let rpath2 = rpath.clone;