Skip to main content

Module utils

Module utils 

Source
Expand description

Shared helpers: filename splitting, worker identity, seeds, and secure mode.

Re-exports§

pub use crate::workers::clear_worker;
pub use crate::workers::set_thread_id_hook;
pub use crate::workers::set_worker;
pub use crate::workers::with_worker;

Structs§

WorkerInfo
Which process and worker this code is running in.

Functions§

base_plus_ext
Split a path into its basename and its full extension.
check_security
Fail when secure mode forbids what.
enforce_security
Whether secure mode is on.
envsubststd
Substitute ${NAME} with the environment variable WDS_NAME.
expand_urls
Expand a URL specification into a concrete list of shard URLs.
format_shard_pattern
Format value into a printf-style integer pattern such as %06d.
is_shard_metadata
Whether a tar member name is shard-level metadata that should be skipped.
make_seed
Combine several values into a 31-bit seed, mirroring utils.make_seed.
next_unique
A process-unique counter, used to keep temporary file names from colliding.
seed_from_str
Hash a string into a seed component.
set_enforce_security
Turn secure mode on or off explicitly.
worker_info
Report the current worker identity.