Module utillib

Source
Expand description

Various utilities that are not specific to evobench

Modules§

arc
ask
auto_vivify
bool_env
cleanup_daemon
A daemon process that clean ups open files when the main process is killed.
clone
conslist
Cons list. Only works with normal references. That’s because making it generic for the reference/container type appears unworkable, even though feasible in principle, due to requiring explicit type parameters on every single cons call. The solution will be to generate the code for versions using Rc, Arc or whatever when needed. (Or, use dyn?, or perhaps/probably rather, enum.)
crypto_hash
Cryptographically hash a data structure
ctx
escaped_display
Trait and temporary wrapper around strings and paths to Display them escaped.
exit_status_ext
fallback
Avoid errors when implementing fallbacks with option structs.
get_terminal_width
Hack to get terminal width to allow making older Clap versions auto-adapt to the current width.
home
html_util
Should add these to ahtml crate.
integers
into_arc_path
invert
invert_index
lazy
Easy lazily constructed values
linear
Run-time “linear types”
linux_mounts
Get information on the filesystem mount points on Linux
logging
Simple logging infrastructure
micro_vec
A vector type that is optimized for storing 0 or 1 elements
ndjson_pipe
path_is_top
path_resolve_home
rayon_util
recycle
ref_or_owned
Stupid. Cow doesn’t work for clonable types that don’t have their own borrows? I don’t understand why. Just do my own now.
safe_string
Try to use data from the OS (OsString) as strings, if possible, fall back to the original data (lossless) if not possible.
slice_or_box
Cow<'t, [T]> requires T to implement ToOwned, i.e. to_owned() wants to make a deep copy, apparently. SliceOrBox is just about the outermost layer. (RefOrOwned only represents a reference or owned value of the same type and hence does not work for this, either.)
tuple_transpose
Convert tuples of Result values into a Result of the Ok values so that errors can be propagated easily. (There is also tuple-transpose crate offering the same, but it might not stay around and has no docs.)
type_name_short
unix
user