Skip to main content

Module util

Module util 

Source
Expand description

General purpose utilities

Modules§

backoff_util
broadcaststream
Copied from tokio_stream 0.1.12 to use our optional Send bounds
secret_file 🔒
Explicit, bounded file/stdin inputs for command-line secrets.
update_merge

Structs§

FmtCompactResultDisplay
A wrapper with fmt::Display for Result<T, E> where E: Error that prints the error chain on Err or - on Ok
FmtErrorCompact
A wrapper with fmt::Display for any E : Error, unsized ones such as dyn Error included, that prints the error and its chain of causes, joined with ": ".
SafeUrl
Wrapper for Url that only prints the scheme, domain, port and path portion of a Url in its Display implementation.
Spanned
StreamEndedError
The stream ended while an item was still expected.

Enums§

SecretInputError
A secret input failure without secret-bearing diagnostic context.

Statics§

SHOW_SECRETS 🔒

Traits§

FmtCompact
Simple utility trait to print error chains
FmtCompactResult
Extension trait to format Result<T, E> compactly (for E: Error)
NextOrPending

Functions§

ensure_single_stdin
Reject multiple consumers of standard input before any secret is read.
get_average
Computes the average of the given u64 slice.
get_median
Computes the median from a slice of sorted u64s
handle_version_hash_command
For CLIs, detects version-hash as a single argument, prints the provided version hash, then exits the process.
read_secret_file
Read UTF-8 secret material from a file, or standard input when path is -.
retry
Run the supplied closure op_fn until it succeeds. Frequency and number of retries is determined by the specified strategy.
write_new
Write out a new file (like std::fs::write but fails if file already exists)
write_new_async
write_overwrite
write_overwrite_async

Type Aliases§

BoxFuture
Future that is Send unless targeting WASM
BoxStream
Stream that is Send unless targeting WASM