Struct dt_core::config::GlobalConfig
source · [−]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: StagingPathThe 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: SyncMethodThe syncing method.
Available values are:
When method is Copy, the above staging setting will be
disabled.
subgroup_prefix: SubgroupPrefixA string to be prepended to a subgroup’s name when creating its
staging directory with the Symlink syncing method.
allow_overwrite: AllowOverwriteWhether 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: IgnoreFailureWhether 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: HostnameSeparatorThe hostname separator.
Specifies default value when Group::hostname_sep is not set.
rename: RenamingRulesGlobal item renaming rules.
Rules defined here will be prepended to renaming rules of each group.
See Group::rename.
Trait Implementations
sourceimpl Clone for GlobalConfig
impl Clone for GlobalConfig
sourcefn clone(&self) -> GlobalConfig
fn clone(&self) -> GlobalConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for GlobalConfig
impl Debug for GlobalConfig
sourceimpl Default for GlobalConfig
impl Default for GlobalConfig
sourcefn default() -> GlobalConfig
fn default() -> GlobalConfig
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for GlobalConfig
impl<'de> Deserialize<'de> for GlobalConfig
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for GlobalConfig
impl Send for GlobalConfig
impl Sync for GlobalConfig
impl Unpin for GlobalConfig
impl UnwindSafe for GlobalConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more