pub struct GlobalConfig {
    pub staging: StagingPath,
    pub method: SyncMethod,
    pub subgroup_prefix: SubgroupPrefix,
    pub allow_overwrite: AllowOverwrite,
    pub ignore_failure: IgnoreFailure,
    pub hostname_sep: HostnameSeparator,
    pub rename: RenamingRules,
}
Expand description

Configures default behaviours.

Fields

staging: StagingPath

The staging root directory.

Only works when method (see below) is set to Symlink. When syncing with Symlink method, items will be copied to their staging directory (composed by joining staging root directory with their group name), then symlinked (as of ln -sf) from their staging directory to the target directory.

Default to $XDG_DATA_HOME/dt/staging if XDG_DATA_HOME is set, or $HOME/.cache/dt/staging if HOME is set. Panics when neither XDG_DATA_HOME nor HOME is set and config file does not specify this.

method: SyncMethod

The syncing method.

Available values are:

When method is Copy, the above staging setting will be disabled.

subgroup_prefix: SubgroupPrefix

A string to be prepended to a subgroup’s name when creating its staging directory with the Symlink syncing method.

allow_overwrite: AllowOverwrite

Whether to allow overwriting existing files.

This alters syncing behaviours when the target file exists. If set to true, no errors/warnings will be omitted when the target file exists; otherwise reports error and skips the existing item. Using dry run to spot the existing files before syncing is recommended.

ignore_failure: IgnoreFailure

Whether to treat errors omitted during syncing as warnings. It has a per-group counterpart to set per-group behaviours. Note that errors occured before or after syncing are NOT affected.

hostname_sep: HostnameSeparator

The hostname separator.

Specifies default value when Group::hostname_sep is not set.

rename: RenamingRules

Global item renaming rules.

Rules defined here will be prepended to renaming rules of each group. See Group::rename.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.