Crate forc_util

Source
Expand description

Utility items shared between forc crates.

Re-exports§

pub use ansiterm;
pub use paste;
pub use serial_test;

Modules§

bytecode
cli
fs_locking
restricted
Helpers for validating and checking names like package and organization names.
tx_utils

Macros§

cli_examples
forc_result_bail

Structs§

ForcCliResult
A wrapper around ForcResult. Designed to be returned from entry points as it handles error reporting and exits with correct exit code.
ForcError
A forc error type which is a wrapper around anyhow::Error. It enables propagation of custom exit code alongisde the original error.
Regex
A compiled regular expression for searching Unicode haystacks.

Constants§

DEFAULT_ERROR_EXIT_CODE
DEFAULT_OUTPUT_DIRECTORY
DEFAULT_SUCCESS_EXIT_CODE

Functions§

create_diagnostics_renderer
Creates Renderer for printing warnings and errors.
default_output_directory
find_file_name
format_diagnostic
git_checkouts_directory
The location at which forc will checkout git repositories.
kebab_to_snake_case
Simple function to convert kebab-case to snake_case.
lock_path
path_lock
Create an advisory lock over the given path.
print_compiling
print_on_failure
print_warnings
program_type_str
user_forc_directory
Returns the user’s .forc directory, $HOME/.forc by default.
validate_name
validate_project_name

Type Aliases§

ForcResult
A result type for forc operations. This shouldn’t be returned from entry points, instead return ForcCliResult to exit with correct exit code.