Module rust_utils::utils [−][src]
Functions
alphabetize | Alphabetizes a vector of strings |
capitalize | capitalize the first letter in a string |
concat_str | concatenates (joins) 2 or more strings in a vector together |
find_char | returns the location (starting from 0) of the first instance of a character in a string skips any leading digits useful for parsing arguments returns the string’s length if the char is not found |
get_dir | returns a list of files/directories using path string |
get_execname | get the name of the executable |
get_filename | get the name of the file/directory from a file path |
get_parent | gets the parent directory from a file path |
get_shared_val | gets a shared value (temp file in /tmp or .cache) value must be a string value |
make_dir | Creates directory (and any parents) and handles any errors that may occur Returns the following codes: OK: Successfully created the directory and its parents ERR: Unable to create the directory |
read_file | abstraction around fs::read_to_string() that includes error handling
Returns the file content as a |
save_file | abstraction around fs::write() that includes error handling Returns the following codes: OK: Save operation successful ERR: There was a problem writing the file |
set_shared_val | saves a string to a shared value (temp file in /tmp or ~/.cache) value must be a string value |