Re-exports
pub use result::Result;
Modules
A replication target tells Verneuil where to copy the content-addressed chunks and directory files it finds in “ready” directories.
The Verneuil library uses Result
s with a simple error type, and relies
on tracing / logging to track information about provenance and to map
low-level errors to higher-level operations.
Macros
Returns an Error
struct derived from initial
, after tracing it
at level level
, with message
and additional fields passed as a
tracing::event
.
If value
evaluates to Err
, matches the error payload against
the patterns, evaluates the corresponding handling expression, and
drops the result.
Creates a fresh Error
struct from the std::io::Error
error
,
and logs it at a dynamic level: if the error’s kind matches
the pattern, the level is benign_level
, otherwise it’s ERROR
.
Creates a fresh Error
struct from the last OS error, and logs it
at a dynamic level: if the OS error’s kind matches the pattern,
the level is benign_level
, otherwise it’s ERROR
.
Returns a fresh Error
struct, after tracing it at level level
,
with message
and additional fields passed as a tracing::event
.
Logs and creates a fresh Error
struct from the last OS error.
Structs
When deserialising a Manifest
, it usually makes sense to use
Manifest::decode_and_validate
and not the prost-derived
Manifest::decode
: the former checks for important invariants.
Initialization options for the Verneuil VFS.
Enums
How do we want to populate a snapshot’s data.
Constants
Read the verneuil configuration from this variable by default.
Functions
Configures the Verneuil VFS.
Configures the replication subsystem, but not the sqlite VFS itself.
Synchronously uploads all the data contained in the spooling directory prefix.
Synchronously copies any pending replication data in path
.
Attempts to return the name for the manifest proto blob associated
with source_db
, and our local snapshot of that blob if available.
Returns the machine’s hostname, or a default placeholder if none.
Attempts to load a default Verneuil configuration from the
var_name_or
environment variable, or VERNEUIL_CONFIG_ENV_VAR
if None
. The variable’s value should be a config JSON for
an Options
struct, or “@/path/to/config_file.json”.
Attempts to fetch the latest manifest for the sqlite database at
path
on hostname_or
(on the current machine if None).
Attempts to fetch the manifest from path
.
Returns a conservatively percent-encoded URI for hostname_or
and
path
. hostname_or
defaults to the local machine’s hostname.
Attempts to parse the Verneuil config in config
. The string’s
contents must be a config JSON for an Options
struct, or a
“@/path/to/config_file.json”.
This is the C-visible configuration function.
Releases the CStr
that backs name
if non-NULL.
Returns the name of the manifest blob for c_hostname
and c_path
, as a C string.
Releases resources owned by info_ptr
Populates dst_ptr
with the replication information for
sqlite file c_db
, inside the c_prefix
spooling directory
(or NULL
for the global default).
Populates dst_ptr
with the replication information for
manifest manifest_name
in our remote replication targets.