#[non_exhaustive]pub struct ConfigWriteOptions { /* private fields */ }Expand description
Options for a config file write (dry-run, typed canonicalization, unset patterns).
Implementations§
Source§impl ConfigWriteOptions
impl ConfigWriteOptions
Sourcepub fn dry_run(self, dry_run: bool) -> Self
pub fn dry_run(self, dry_run: bool) -> Self
When true, return a ConfigWritePreview instead of writing disk.
Sourcepub fn value_type(self, ty: ConfigValueType) -> Self
pub fn value_type(self, ty: ConfigValueType) -> Self
Canonicalize value with Git --type rules before writing.
Sourcepub fn replace_all(self, replace_all: bool) -> Self
pub fn replace_all(self, replace_all: bool) -> Self
Replace every occurrence of key with value (Git replace-all semantics).
When false (the default), a single-valued set overwrites one slot; see ConfigFile::set.
Sourcepub fn replace_value_pattern(self, pattern: impl Into<String>) -> Self
pub fn replace_value_pattern(self, pattern: impl Into<String>) -> Self
When using Self::replace_all, only replace values matching this Git config value pattern.
Sourcepub fn unset_value_pattern(self, pattern: impl Into<String>) -> Self
pub fn unset_value_pattern(self, pattern: impl Into<String>) -> Self
When unsetting, remove only values matching this pattern (unset-all / --value).
Sourcepub fn is_dry_run(&self) -> bool
pub fn is_dry_run(&self) -> bool
Whether this write should only preview the change.
Trait Implementations§
Source§impl Clone for ConfigWriteOptions
impl Clone for ConfigWriteOptions
Source§impl Debug for ConfigWriteOptions
impl Debug for ConfigWriteOptions
Auto Trait Implementations§
impl Forget for ConfigWriteOptions
impl Freeze for ConfigWriteOptions
impl RefUnwindSafe for ConfigWriteOptions
impl Send for ConfigWriteOptions
impl Sync for ConfigWriteOptions
impl Unpin for ConfigWriteOptions
impl UnsafeUnpin for ConfigWriteOptions
impl UnwindSafe for ConfigWriteOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more