Expand description
§Common utilities
Common utilities and structs used within the ACORN library
Modules§
- cli
- Command line interface (CLI) utilities
Structs§
- Constant
- Struct for using and sharing constants
- Label
- Struct for using and sharing colorized logging labels
- Semantic
Version - Semantic version
- Semantic
Version Builder - Use builder syntax to set the inputs and finish with
build()
.
Enums§
- Mime
Type - MIME types
- Programming
Language - Programming languages
Functions§
- checksum
- Get SHA256 hash of a file
- command_
exists - Checks if a given command exists in current terminal context.
- download_
binary - Downloads a binary file from the given URL to the destination path.
- extension
- Get file extension
- files_
all - Returns a vector of
PathBuf
containing all files in a directory that match the given extension and do not match the ignore pattern. - files_
from_ git_ branch - Returns a vector of
PathBuf
containing all files changed in the given Git branch relative to the default branch. - files_
from_ git_ commit - Returns a vector of
PathBuf
containing all files changed in the given Git commit. - generate_
guid - Generates a random GUID using a custom alphabet.
- git_
branch_ name - Returns the current Git branch name if the
git
command is available and executed successfully. - git_
default_ branch_ name - Returns the default Git branch name if the
git
command is available and executed successfully. - image_
paths - Returns a vector of
PathBuf
representing paths to all images found in the given directory and all of its subdirectories. - make_
executable - Makes the given file executable.
- parent
- Returns the parent directory of the given path.
- path_
to_ string - Converts a
PathBuf
into aString
representation of the absolute path. - pretty_
print - Prints
text
to stdout using syntax highlighting for the specifiedsyntax
. - print_
changes - Prints a diff of changes between two strings.
- print_
values_ as_ table - Prints the given values as a table.
- read_
file - Reads the given file and returns its contents as a string.
- standard_
project_ folder - Returns path to a folder in the operating system’s cache directory that is unique to the given
namespace
with a random UUID as the name of the final folder. - suffix
- Returns “s” if the given value is not 1, otherwise returns an empty string.
- text_
diff_ changes - Computes the differences between two strings line by line and returns a vector of changes.
- to_
string - Convert a vector of string slices to a vector of strings
- tokio_
runtime - Create a new Tokio runtime
- write_
file - Writes the given content to a file at the given path.