Skip to main content

Module welcome

Module welcome 

Source

StructsΒ§

Crate πŸ”’
CratesIoResponse πŸ”’

FunctionsΒ§

check_for_updates πŸ”’
Checks for updates to the crate, and prints a message if an update is available
check_version πŸ”’
Given a possibly undefined version number, check if it’s present and supported
default_for πŸ”’
The value to pre-fill for a field’s interactive prompt, where a sensible one exists
exit_interrupted πŸ”’
Print the cancellation notice and exit cleanly
get_env πŸ”’
Given a key, get the value from the environmental variables, and print it to the console
get_latest_version πŸ”’
Gets the latest version of the crate from crates.io
masked_loop πŸ”’
print_ascii_art πŸ”’
Prints the AdGuardian ASCII art to console
print_error πŸ”’
Print error message, along with (optional) stack trace, then exit
print_info πŸ”’
Reusable function that just prints success messages to the console
prompt_for πŸ”’
Prompt for a single field, re-prompting until the input is valid. Masks passwords, applies the field’s default on empty input, validates the port is numeric, and exits cleanly if the user interrupts with Ctrl-C.
read_field πŸ”’
Print the prompt and read a value, masking secret fields on an interactive terminal
read_input πŸ”’
Read a field off the async runtime threads
read_masked πŸ”’
Read a line from the terminal in raw mode, echoing nothing. Ctrl-C cancels.
verify_connection πŸ”’
With the users specified AdGuard details, verify the connection. Returns Err on a failed connection (so the caller can retry); exits on rejected auth or an unsupported version, which retrying wouldn’t fix.
welcome
Initiate the welcome script This function will:
with_retries
Run an async operation, retrying on error up to attempts times, delay apart. Each failure is reported; the last error is returned once attempts are exhausted.